@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 +1 -1
- package/src/admin/booking/booking.calculator.ts +16 -12
- package/dist/admin/index.js +0 -9574
- package/dist/admin/index.mjs +0 -9511
- package/dist/index.d.mts +0 -6971
- package/dist/index.d.ts +0 -6971
package/package.json
CHANGED
|
@@ -150,8 +150,9 @@ export class BookingAvailabilityCalculator {
|
|
|
150
150
|
tz: string
|
|
151
151
|
): TimeInterval[] {
|
|
152
152
|
const workingIntervals: TimeInterval[] = [];
|
|
153
|
-
|
|
154
|
-
|
|
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.
|
|
197
|
-
? DateTime.
|
|
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.
|
|
201
|
-
? DateTime.
|
|
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
|
-
|
|
357
|
-
|
|
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.
|
|
391
|
-
? DateTime.
|
|
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.
|
|
395
|
-
? DateTime.
|
|
398
|
+
workEnd > DateTime.fromMillis(endDate.getTime(), { zone: tz })
|
|
399
|
+
? DateTime.fromMillis(endDate.getTime(), { zone: tz })
|
|
396
400
|
: workEnd;
|
|
397
401
|
|
|
398
402
|
workingIntervals.push({
|