@blackcode_sa/metaestetics-api 1.12.23 → 1.12.24

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.
@@ -6640,8 +6640,8 @@ var BookingAvailabilityCalculator = class {
6640
6640
  */
6641
6641
  static createWorkingHoursIntervals(workingHours, startDate, endDate, tz) {
6642
6642
  const workingIntervals = [];
6643
- let start = import_luxon.DateTime.fromJSDate(startDate, { zone: tz });
6644
- const end = import_luxon.DateTime.fromJSDate(endDate, { zone: tz });
6643
+ let start = import_luxon.DateTime.fromMillis(startDate.getTime(), { zone: tz });
6644
+ const end = import_luxon.DateTime.fromMillis(endDate.getTime(), { zone: tz });
6645
6645
  while (start <= end) {
6646
6646
  const dayOfWeek = start.weekday;
6647
6647
  const dayName = [
@@ -6671,8 +6671,8 @@ var BookingAvailabilityCalculator = class {
6671
6671
  millisecond: 0
6672
6672
  });
6673
6673
  if (workEnd.toMillis() > startDate.getTime() && workStart.toMillis() < endDate.getTime()) {
6674
- const intervalStart = workStart < import_luxon.DateTime.fromJSDate(startDate, { zone: tz }) ? import_luxon.DateTime.fromJSDate(startDate, { zone: tz }) : workStart;
6675
- const intervalEnd = workEnd > import_luxon.DateTime.fromJSDate(endDate, { zone: tz }) ? import_luxon.DateTime.fromJSDate(endDate, { zone: tz }) : workEnd;
6674
+ const intervalStart = workStart < import_luxon.DateTime.fromMillis(startDate.getTime(), { zone: tz }) ? import_luxon.DateTime.fromMillis(startDate.getTime(), { zone: tz }) : workStart;
6675
+ const intervalEnd = workEnd > import_luxon.DateTime.fromMillis(endDate.getTime(), { zone: tz }) ? import_luxon.DateTime.fromMillis(endDate.getTime(), { zone: tz }) : workEnd;
6676
6676
  workingIntervals.push({
6677
6677
  start: import_firestore2.Timestamp.fromMillis(intervalStart.toMillis()),
6678
6678
  end: import_firestore2.Timestamp.fromMillis(intervalEnd.toMillis())
@@ -6779,8 +6779,8 @@ var BookingAvailabilityCalculator = class {
6779
6779
  */
6780
6780
  static createPractitionerWorkingHoursIntervals(workingHours, startDate, endDate, tz) {
6781
6781
  const workingIntervals = [];
6782
- let start = import_luxon.DateTime.fromJSDate(startDate, { zone: tz });
6783
- const end = import_luxon.DateTime.fromJSDate(endDate, { zone: tz });
6782
+ let start = import_luxon.DateTime.fromMillis(startDate.getTime(), { zone: tz });
6783
+ const end = import_luxon.DateTime.fromMillis(endDate.getTime(), { zone: tz });
6784
6784
  while (start <= end) {
6785
6785
  const dayOfWeek = start.weekday;
6786
6786
  const dayName = [
@@ -6803,8 +6803,8 @@ var BookingAvailabilityCalculator = class {
6803
6803
  });
6804
6804
  const workEnd = start.set({ hour: endHours, minute: endMinutes });
6805
6805
  if (workEnd.toMillis() > startDate.getTime() && workStart.toMillis() < endDate.getTime()) {
6806
- const intervalStart = workStart < import_luxon.DateTime.fromJSDate(startDate, { zone: tz }) ? import_luxon.DateTime.fromJSDate(startDate, { zone: tz }) : workStart;
6807
- const intervalEnd = workEnd > import_luxon.DateTime.fromJSDate(endDate, { zone: tz }) ? import_luxon.DateTime.fromJSDate(endDate, { zone: tz }) : workEnd;
6806
+ const intervalStart = workStart < import_luxon.DateTime.fromMillis(startDate.getTime(), { zone: tz }) ? import_luxon.DateTime.fromMillis(startDate.getTime(), { zone: tz }) : workStart;
6807
+ const intervalEnd = workEnd > import_luxon.DateTime.fromMillis(endDate.getTime(), { zone: tz }) ? import_luxon.DateTime.fromMillis(endDate.getTime(), { zone: tz }) : workEnd;
6808
6808
  workingIntervals.push({
6809
6809
  start: import_firestore2.Timestamp.fromMillis(intervalStart.toMillis()),
6810
6810
  end: import_firestore2.Timestamp.fromMillis(intervalEnd.toMillis())
@@ -6578,8 +6578,8 @@ var BookingAvailabilityCalculator = class {
6578
6578
  */
6579
6579
  static createWorkingHoursIntervals(workingHours, startDate, endDate, tz) {
6580
6580
  const workingIntervals = [];
6581
- let start = DateTime.fromJSDate(startDate, { zone: tz });
6582
- const end = DateTime.fromJSDate(endDate, { zone: tz });
6581
+ let start = DateTime.fromMillis(startDate.getTime(), { zone: tz });
6582
+ const end = DateTime.fromMillis(endDate.getTime(), { zone: tz });
6583
6583
  while (start <= end) {
6584
6584
  const dayOfWeek = start.weekday;
6585
6585
  const dayName = [
@@ -6609,8 +6609,8 @@ var BookingAvailabilityCalculator = class {
6609
6609
  millisecond: 0
6610
6610
  });
6611
6611
  if (workEnd.toMillis() > startDate.getTime() && workStart.toMillis() < endDate.getTime()) {
6612
- const intervalStart = workStart < DateTime.fromJSDate(startDate, { zone: tz }) ? DateTime.fromJSDate(startDate, { zone: tz }) : workStart;
6613
- const intervalEnd = workEnd > DateTime.fromJSDate(endDate, { zone: tz }) ? DateTime.fromJSDate(endDate, { zone: tz }) : workEnd;
6612
+ const intervalStart = workStart < DateTime.fromMillis(startDate.getTime(), { zone: tz }) ? DateTime.fromMillis(startDate.getTime(), { zone: tz }) : workStart;
6613
+ const intervalEnd = workEnd > DateTime.fromMillis(endDate.getTime(), { zone: tz }) ? DateTime.fromMillis(endDate.getTime(), { zone: tz }) : workEnd;
6614
6614
  workingIntervals.push({
6615
6615
  start: Timestamp.fromMillis(intervalStart.toMillis()),
6616
6616
  end: Timestamp.fromMillis(intervalEnd.toMillis())
@@ -6717,8 +6717,8 @@ var BookingAvailabilityCalculator = class {
6717
6717
  */
6718
6718
  static createPractitionerWorkingHoursIntervals(workingHours, startDate, endDate, tz) {
6719
6719
  const workingIntervals = [];
6720
- let start = DateTime.fromJSDate(startDate, { zone: tz });
6721
- const end = DateTime.fromJSDate(endDate, { zone: tz });
6720
+ let start = DateTime.fromMillis(startDate.getTime(), { zone: tz });
6721
+ const end = DateTime.fromMillis(endDate.getTime(), { zone: tz });
6722
6722
  while (start <= end) {
6723
6723
  const dayOfWeek = start.weekday;
6724
6724
  const dayName = [
@@ -6741,8 +6741,8 @@ var BookingAvailabilityCalculator = class {
6741
6741
  });
6742
6742
  const workEnd = start.set({ hour: endHours, minute: endMinutes });
6743
6743
  if (workEnd.toMillis() > startDate.getTime() && workStart.toMillis() < endDate.getTime()) {
6744
- const intervalStart = workStart < DateTime.fromJSDate(startDate, { zone: tz }) ? DateTime.fromJSDate(startDate, { zone: tz }) : workStart;
6745
- const intervalEnd = workEnd > DateTime.fromJSDate(endDate, { zone: tz }) ? DateTime.fromJSDate(endDate, { zone: tz }) : workEnd;
6744
+ const intervalStart = workStart < DateTime.fromMillis(startDate.getTime(), { zone: tz }) ? DateTime.fromMillis(startDate.getTime(), { zone: tz }) : workStart;
6745
+ const intervalEnd = workEnd > DateTime.fromMillis(endDate.getTime(), { zone: tz }) ? DateTime.fromMillis(endDate.getTime(), { zone: tz }) : workEnd;
6746
6746
  workingIntervals.push({
6747
6747
  start: Timestamp.fromMillis(intervalStart.toMillis()),
6748
6748
  end: Timestamp.fromMillis(intervalEnd.toMillis())
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.24",
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({