@blackcode_sa/metaestetics-api 1.12.23 → 1.12.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.12.23",
4
+ "version": "1.12.25",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -150,8 +150,9 @@ export class BookingAvailabilityCalculator {
150
150
  tz: string
151
151
  ): TimeInterval[] {
152
152
  const workingIntervals: TimeInterval[] = [];
153
- let start = DateTime.fromJSDate(startDate, { zone: tz });
154
- const end = DateTime.fromJSDate(endDate, { zone: tz });
153
+ // FIXED: Use fromMillis instead of fromJSDate to avoid timezone reinterpretation
154
+ let start = DateTime.fromMillis(startDate.getTime(), { zone: tz });
155
+ const end = DateTime.fromMillis(endDate.getTime(), { zone: tz });
155
156
 
156
157
  while (start <= end) {
157
158
  const dayOfWeek = start.weekday; // 1 for Monday, 7 for Sunday
@@ -192,13 +193,14 @@ export class BookingAvailabilityCalculator {
192
193
  workEnd.toMillis() > startDate.getTime() &&
193
194
  workStart.toMillis() < endDate.getTime()
194
195
  ) {
196
+ // FIXED: Use fromMillis instead of fromJSDate
195
197
  const intervalStart =
196
- workStart < DateTime.fromJSDate(startDate, { zone: tz })
197
- ? DateTime.fromJSDate(startDate, { zone: tz })
198
+ workStart < DateTime.fromMillis(startDate.getTime(), { zone: tz })
199
+ ? DateTime.fromMillis(startDate.getTime(), { zone: tz })
198
200
  : workStart;
199
201
  const intervalEnd =
200
- workEnd > DateTime.fromJSDate(endDate, { zone: tz })
201
- ? DateTime.fromJSDate(endDate, { zone: tz })
202
+ workEnd > DateTime.fromMillis(endDate.getTime(), { zone: tz })
203
+ ? DateTime.fromMillis(endDate.getTime(), { zone: tz })
202
204
  : workEnd;
203
205
 
204
206
  workingIntervals.push({
@@ -353,8 +355,9 @@ export class BookingAvailabilityCalculator {
353
355
  tz: string
354
356
  ): TimeInterval[] {
355
357
  const workingIntervals: TimeInterval[] = [];
356
- let start = DateTime.fromJSDate(startDate, { zone: tz });
357
- const end = DateTime.fromJSDate(endDate, { zone: tz });
358
+ // FIXED: Use fromMillis instead of fromJSDate to avoid timezone reinterpretation
359
+ let start = DateTime.fromMillis(startDate.getTime(), { zone: tz });
360
+ const end = DateTime.fromMillis(endDate.getTime(), { zone: tz });
358
361
 
359
362
  while (start <= end) {
360
363
  const dayOfWeek = start.weekday;
@@ -386,13 +389,14 @@ export class BookingAvailabilityCalculator {
386
389
  workEnd.toMillis() > startDate.getTime() &&
387
390
  workStart.toMillis() < endDate.getTime()
388
391
  ) {
392
+ // FIXED: Use fromMillis instead of fromJSDate
389
393
  const intervalStart =
390
- workStart < DateTime.fromJSDate(startDate, { zone: tz })
391
- ? DateTime.fromJSDate(startDate, { zone: tz })
394
+ workStart < DateTime.fromMillis(startDate.getTime(), { zone: tz })
395
+ ? DateTime.fromMillis(startDate.getTime(), { zone: tz })
392
396
  : workStart;
393
397
  const intervalEnd =
394
- workEnd > DateTime.fromJSDate(endDate, { zone: tz })
395
- ? DateTime.fromJSDate(endDate, { zone: tz })
398
+ workEnd > DateTime.fromMillis(endDate.getTime(), { zone: tz })
399
+ ? DateTime.fromMillis(endDate.getTime(), { zone: tz })
396
400
  : workEnd;
397
401
 
398
402
  workingIntervals.push({