@bash-app/bash-common 30.49.0 → 30.50.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.49.0",
3
+ "version": "30.50.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -30,7 +30,6 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@prisma/client": "^6.1.0",
33
- "dayjs": "^1.11.13",
34
33
  "luxon": "^3.5.0",
35
34
  "prisma": "^6.1.0",
36
35
  "react-tailwindcss-datepicker": "^1.6.6",
@@ -1,19 +1,14 @@
1
+ import { DateTime } from "luxon";
1
2
  import { DateType, DateValueType } from "react-tailwindcss-datepicker";
2
- import dayjs, { Dayjs } from "dayjs";
3
- import dayjsUtc from "dayjs/plugin/utc";
4
- import dayjsTimeZone from "dayjs/plugin/timezone";
5
3
  import { DateTimeArgType } from "../definitions";
6
4
 
7
- dayjs.extend(dayjsUtc);
8
- dayjs.extend(dayjsTimeZone);
9
-
10
5
  const PARSE_TIME_REG = /^(\d{1,2}):(\d{2}) ?([APM]{0,2})$/i;
11
6
 
12
- export const DATETIME_FORMAT_STANDARD = "MMM D, YYYY - h:mm A";
13
- export const DATETIME_FORMAT_ISO_LIKE = "YYYY-MM-DD HH:mm";
14
- export const DATE_FORMAT_STANDARD = "MM/DD/YYYY";
15
- export const DATE_FORMAT_ISO = "YYYY-MM-DD";
16
- export const TIME_FORMAT_AM_PM = "h:mm A";
7
+ export const DATETIME_FORMAT_STANDARD = "MMM d, yyyy - h:mm a";
8
+ export const DATETIME_FORMAT_ISO_LIKE = "yyyy-MM-dd HH:mm";
9
+ export const DATE_FORMAT_STANDARD = "MM/dd/yyyy";
10
+ export const DATE_FORMAT_ISO = "yyyy-MM-dd";
11
+ export const TIME_FORMAT_AM_PM = "h:mm a";
17
12
 
18
13
  export interface ITime {
19
14
  hours: number;
@@ -21,42 +16,46 @@ export interface ITime {
21
16
  ampm: "AM" | "PM";
22
17
  }
23
18
 
19
+ export function getLocalTimezoneName(): string {
20
+ return DateTime.local().zoneName;
21
+ }
22
+
24
23
  export function formatDateRangeBasic(
25
24
  startDateTimeArg: Date | null,
26
25
  endDateTimeArg: Date | null
27
26
  ): string {
28
- const startDateTime = dayjs(startDateTimeArg).tz(dayjs.tz.guess());
29
- const endDateTime = dayjs(endDateTimeArg).tz(dayjs.tz.guess());
30
- if (startDateTime.isSame(endDateTime, "day")) {
31
- return `${startDateTime.format(
27
+ const userTimezone = getLocalTimezoneName();
28
+ const startDateTime = DateTime.fromJSDate(startDateTimeArg || new Date()).setZone(userTimezone);
29
+ const endDateTime = DateTime.fromJSDate(endDateTimeArg || new Date()).setZone(userTimezone);
30
+
31
+ if (startDateTime.hasSame(endDateTime, "day")) {
32
+ return `${startDateTime.toFormat(
32
33
  DATETIME_FORMAT_STANDARD
33
- )} to ${endDateTime.format(TIME_FORMAT_AM_PM)}`;
34
+ )} to ${endDateTime.toFormat(TIME_FORMAT_AM_PM)}`;
34
35
  }
35
36
 
36
- return `${startDateTime.format(
37
+ return `${startDateTime.toFormat(
37
38
  DATETIME_FORMAT_STANDARD
38
- )} to ${endDateTime.format(DATETIME_FORMAT_STANDARD)}`;
39
+ )} to ${endDateTime.toFormat(DATETIME_FORMAT_STANDARD)}`;
39
40
  }
40
41
 
41
42
  export function formatDateRange(
42
43
  startDateTimeArg: Date | null,
43
44
  endDateTimeArg: Date | null
44
45
  ): string {
45
- const startDateTime = ensureDateTimeIsLocalDateTime(startDateTimeArg).tz(
46
- dayjs.tz.guess()
47
- );
48
- const endDateTime = ensureDateTimeIsLocalDateTime(endDateTimeArg).tz(
49
- dayjs.tz.guess()
50
- );
51
- if (startDateTime.isSame(endDateTime, "day")) {
52
- return `${startDateTime.format(
46
+ const userTimezone = getLocalTimezoneName();
47
+ const startDateTime = ensureDateTimeIsLocalDateTime(startDateTimeArg).setZone(userTimezone);
48
+ const endDateTime = ensureDateTimeIsLocalDateTime(endDateTimeArg).setZone(userTimezone);
49
+
50
+ if (startDateTime.hasSame(endDateTime, "day")) {
51
+ return `${startDateTime.toFormat(
53
52
  DATETIME_FORMAT_STANDARD
54
- )} to ${endDateTime.format(TIME_FORMAT_AM_PM)}`;
53
+ )} to ${endDateTime.toFormat(TIME_FORMAT_AM_PM)}`;
55
54
  }
56
55
 
57
- return `${startDateTime.format(
56
+ return `${startDateTime.toFormat(
58
57
  DATETIME_FORMAT_STANDARD
59
- )} to ${endDateTime.format(DATETIME_FORMAT_STANDARD)}`;
58
+ )} to ${endDateTime.toFormat(DATETIME_FORMAT_STANDARD)}`;
60
59
  }
61
60
 
62
61
  export function ensureIsDateTime(
@@ -84,8 +83,9 @@ export function normalizeDate(
84
83
  }
85
84
 
86
85
  // Normalize to UTC and start of minute
87
- return dayjs(date).utc().startOf("minute").toDate();
86
+ return DateTime.fromJSDate(date).toUTC().startOf("minute").toJSDate();
88
87
  }
88
+
89
89
  export function normalizeDates(
90
90
  dates: (Date | string | undefined | null)[]
91
91
  ): Date[] {
@@ -108,12 +108,11 @@ export function dateWithinDateRange(
108
108
  date: DateTimeArgType,
109
109
  dateRange: DateValueType | undefined
110
110
  ): boolean {
111
- const startDate = dayjs(dateRange?.startDate).startOf("day").toDate();
112
- const endDate = dayjs(dateRange?.endDate).endOf("day").toDate();
111
+ const startDate = DateTime.fromJSDate(dateRange?.startDate || new Date()).startOf("day");
112
+ const endDate = DateTime.fromJSDate(dateRange?.endDate || new Date()).endOf("day");
113
+ const checkDate = DateTime.fromJSDate(new Date(date || ''));
113
114
 
114
- return (
115
- compareDateTime(date, startDate) >= 0 && compareDateTime(date, endDate) < 0
116
- );
115
+ return checkDate >= startDate && checkDate < endDate;
117
116
  }
118
117
 
119
118
  export function findLatestDateTime(
@@ -197,76 +196,82 @@ export function setDateButPreserveTime(
197
196
  }
198
197
 
199
198
  // Get local timezone
200
- const localTimeZone = dayjs.tz.guess();
201
-
202
- // Format date and time parts
203
- const datePart = dayjs(dateArg).tz(localTimeZone).format("YYYY-MM-DD"); // Local date
204
- const timePart = dayjs(dateWithTheTimeYouWantToKeep)
205
- .tz(localTimeZone)
206
- .format("HH:mm"); // Local time
199
+ const localTimeZone = getLocalTimezoneName();
200
+
201
+ // Extract date and time components using Luxon
202
+ const dateOnly = DateTime.fromJSDate(new Date(dateArg)).setZone(localTimeZone);
203
+ const timeOnly = DateTime.fromJSDate(new Date(dateWithTheTimeYouWantToKeep)).setZone(localTimeZone);
204
+
205
+ // Combine date from first argument with time from second argument
206
+ const combinedDateTime = dateOnly.set({
207
+ hour: timeOnly.hour,
208
+ minute: timeOnly.minute,
209
+ second: 0,
210
+ millisecond: 0
211
+ });
207
212
 
208
- // Combine into an ISO string
209
- const combinedDateTimeString = `${datePart}T${timePart}`;
210
213
  console.log("Combining date and time:", {
211
- datePart,
212
- timePart,
213
- combinedDateTimeString,
214
+ dateOnly: dateOnly.toISO(),
215
+ timeOnly: timeOnly.toFormat("HH:mm"),
216
+ combinedDateTime: combinedDateTime.toISO(),
214
217
  localTimeZone,
215
218
  });
216
219
 
217
- // Convert to UTC
218
- const combinedDateTime = dayjs
219
- .tz(combinedDateTimeString, localTimeZone)
220
- .toDate();
221
- if (isNaN(combinedDateTime.getTime())) {
222
- console.error("Invalid combined datetime:", combinedDateTimeString);
220
+ const result = combinedDateTime.toJSDate();
221
+ if (isNaN(result.getTime())) {
222
+ console.error("Invalid combined datetime:", combinedDateTime.toISO());
223
223
  throw new Error("Invalid date or time format.");
224
224
  }
225
225
 
226
- console.log("Final combined DateTime (UTC):", combinedDateTime);
227
- return combinedDateTime;
226
+ console.log("Final combined DateTime (UTC):", result);
227
+ return result;
228
228
  }
229
229
 
230
230
  export function setTimeOnDate(
231
231
  date: DateType | Date | undefined,
232
232
  parsedTime: ITime | null
233
233
  ): Date {
234
- const isValidDate = dayjs(date).isValid();
235
- const dateTime = new Date(isValidDate && date ? date : Date.now());
234
+ const dateTime = DateTime.fromJSDate(date ? new Date(date) : new Date());
235
+
236
236
  if (parsedTime) {
237
- const parsedTimeDate = new Date();
238
- parsedTimeDate.setHours(parsedTime.hours, parsedTime.minutes, 0); // Will change the date depending on time; corrected later
239
- const correctTimeOnDate = setDateButPreserveTime(dateTime, parsedTimeDate);
240
- return correctTimeOnDate;
237
+ const updatedDateTime = dateTime.set({
238
+ hour: parsedTime.hours,
239
+ minute: parsedTime.minutes,
240
+ second: 0,
241
+ millisecond: 0
242
+ });
243
+ return setDateButPreserveTime(dateTime.toJSDate(), updatedDateTime.toJSDate());
241
244
  }
242
- return dateTime;
245
+ return dateTime.toJSDate();
243
246
  }
244
247
 
245
248
  export function ensureDateTimeIsLocalDateTime(
246
- dateArg: DateType | Dayjs | undefined
247
- ): Dayjs {
248
- if (dayjs(dateArg).isUTC()) {
249
- const dateLocalTimeZone = dayjs(dateArg);
250
- return dateLocalTimeZone;
251
- } else {
252
- return dayjs(dateArg ?? Date.now());
249
+ dateArg: DateType | DateTime | undefined
250
+ ): DateTime {
251
+ if (!dateArg) {
252
+ return DateTime.local();
253
+ }
254
+
255
+ if (dateArg instanceof DateTime) {
256
+ return dateArg.setZone(getLocalTimezoneName());
253
257
  }
258
+
259
+ const dt = DateTime.fromJSDate(new Date(dateArg));
260
+ return dt.setZone(getLocalTimezoneName());
254
261
  }
255
262
 
256
263
  export function formatDateTimeToTimeString(
257
264
  date: Date | string | undefined | null
258
265
  ): string {
259
- date = new Date(date ?? Date.now());
260
- const result = dayjs(date).format("h:mm A");
261
- return result;
266
+ const dt = DateTime.fromJSDate(new Date(date ?? Date.now()));
267
+ return dt.toFormat("h:mm a");
262
268
  }
263
269
 
264
270
  export function formatDateTimeToTimeString24hr(
265
271
  date: Date | string | undefined | null
266
272
  ): string {
267
- date = new Date(date ?? Date.now());
268
- const result = dayjs(date).format("h:mm");
269
- return result;
273
+ const dt = DateTime.fromJSDate(new Date(date ?? Date.now()));
274
+ return dt.toFormat("H:mm");
270
275
  }
271
276
 
272
277
  export function parseTimeString(timeStr: string): ITime | null {
@@ -293,6 +298,7 @@ export function parseTimeString(timeStr: string): ITime | null {
293
298
  }
294
299
  return null;
295
300
  }
301
+
296
302
  export function timestampMinutesFromNow(minutes: number): number {
297
- return Math.floor(new Date().getTime() / 1000 + minutes * 60);
303
+ return Math.floor(DateTime.local().plus({ minutes }).toSeconds());
298
304
  }
@@ -281,11 +281,6 @@ export function getLocalTimezone() {
281
281
  return utcOffsetMinutesToTimezone(localDateTime.offset);
282
282
  }
283
283
 
284
- export function getLocalTimezoneName() {
285
- const localDateTime = DateTime.local();
286
- return localDateTime.zoneName;
287
- }
288
-
289
284
  export function dateTimeFormatDateRange(
290
285
  startDateTimeArg: DateTime | null,
291
286
  endDateTimeArg: DateTime | null
@@ -1,11 +1,7 @@
1
- import {DayOfWeek, Recurrence, RecurringFrequency} from "@prisma/client";
2
- import dayjs, {Dayjs} from "dayjs";
3
- import dayjsWeekDay from "dayjs/plugin/weekday";
4
- import {DateTimeArgType} from "../definitions";
5
- import {compareDateTime, DATETIME_FORMAT_ISO_LIKE} from "./dateTimeUtils";
6
-
7
- dayjs.extend(dayjsWeekDay);
8
-
1
+ import { DayOfWeek, Recurrence, RecurringFrequency } from "@prisma/client";
2
+ import { DateTime, WeekdayNumbers } from "luxon";
3
+ import { DateTimeArgType } from "../definitions";
4
+ import { compareDateTime, DATETIME_FORMAT_ISO_LIKE } from "./dateTimeUtils";
9
5
 
10
6
  export function getRecurringBashEventPossibleDateTimes(startDateTime: DateTimeArgType,
11
7
  recurrence: Recurrence | undefined | null): Date[] {
@@ -13,20 +9,19 @@ export function getRecurringBashEventPossibleDateTimes(startDateTime: DateTimeAr
13
9
  }
14
10
 
15
11
  export function getRecurringBashEventPossibleDayjsTimes(startDateTime: DateTimeArgType,
16
- recurrence: Recurrence | undefined | null): Dayjs[] {
17
- return getRecurringBashEventPossibleDatesTimesInternal(startDateTime, recurrence, false) as Dayjs[];
12
+ recurrence: Recurrence | undefined | null): DateTime[] {
13
+ return getRecurringBashEventPossibleDatesTimesInternal(startDateTime, recurrence, false) as DateTime[];
18
14
  }
19
15
 
20
-
21
16
  function getRecurringBashEventPossibleDatesTimesInternal(startDateTime: DateTimeArgType,
22
17
  recurrence: Recurrence | undefined | null,
23
- toDate: boolean): (Dayjs | Date)[] {
18
+ toDate: boolean): (DateTime | Date)[] {
24
19
  if (!recurrence || !recurrence.frequency || recurrence.frequency === RecurringFrequency.Never) {
25
20
  return [];
26
21
  }
27
22
 
28
- let recurrenceDates: Dayjs[] = [];
29
- const beginningDate = findEarliestPossibleBashEventDate(startDateTime) as Dayjs; // Don't allow dates before the current date
23
+ let recurrenceDates: DateTime[] = [];
24
+ const beginningDate = findEarliestPossibleBashEventDate(startDateTime) as DateTime; // Don't allow dates before the current date
30
25
 
31
26
  switch (recurrence.frequency) {
32
27
  case RecurringFrequency.Weekly:
@@ -35,14 +30,15 @@ function getRecurringBashEventPossibleDatesTimesInternal(startDateTime: DateTime
35
30
  default:
36
31
  console.error(`Only weekly frequency is currently supported`);
37
32
  }
38
- return recurrenceDates.map((date: Dayjs): string => date.format(DATETIME_FORMAT_ISO_LIKE))
33
+ return recurrenceDates.map((date: DateTime): string => date.toFormat(DATETIME_FORMAT_ISO_LIKE))
39
34
  .sort()
40
- .map((dateStr: string): Dayjs | Date => {
35
+ .map((dateStr: string): DateTime | Date => {
36
+ const luxonDate = DateTime.fromFormat(dateStr, DATETIME_FORMAT_ISO_LIKE);
41
37
  if (toDate) {
42
- return dayjs(dateStr).toDate();
38
+ return luxonDate.toJSDate();
43
39
  }
44
40
  else {
45
- return dayjs(dateStr);
41
+ return luxonDate;
46
42
  }
47
43
  });
48
44
  }
@@ -52,25 +48,25 @@ function getRecurringBashEventPossibleDatesTimesInternal(startDateTime: DateTime
52
48
  * @param beginningDateTime The beginning DateTime of the event, adjusted to be no earlier than now.
53
49
  * @param recurrence
54
50
  */
55
- function getWeeklyRecurringDates(beginningDateTime: Dayjs, recurrence: Recurrence): Dayjs[] {
51
+ function getWeeklyRecurringDates(beginningDateTime: DateTime, recurrence: Recurrence): DateTime[] {
56
52
  if (recurrence.frequency !== RecurringFrequency.Weekly) {
57
53
  throw new Error(`Cannot do a weekly recurrence if the frequency isn't weekly.`);
58
54
  }
59
55
 
60
56
  const interval = recurrence.interval ?? 1;
61
- const recurrenceEnds = dayjs(recurrence.ends).endOf('day'); // Get the end of the day to not miss the last day
62
- const numberOfDays = recurrenceEnds.diff(beginningDateTime, 'days');
57
+ const recurrenceEnds = DateTime.fromJSDate(new Date(recurrence.ends || '')).endOf('day'); // Get the end of the day to not miss the last day
58
+ const numberOfDays = recurrenceEnds.diff(beginningDateTime, 'days').days;
63
59
  const numberOfWeeks = Math.ceil((numberOfDays / 7) / interval); // Get the number of days and then round up so that we include the ending date
64
60
 
65
- const recurrenceDates: Dayjs[] = [];
61
+ const recurrenceDates: DateTime[] = [];
66
62
  let theNextWeekOfRecurrences = beginningDateTime;
67
63
 
68
64
  // Go week by week getting the next recurrence date
69
65
  for (let i = 0; i < numberOfWeeks; i++) {
70
- let weekday: Dayjs | null = null;
66
+ let weekday: DateTime | null = null;
71
67
  for (const dayOfWeekEnum of recurrence.repeatOnDays) {
72
68
  const dayOfWeekNum = dayOfWeekEnumToDayNumber(dayOfWeekEnum);
73
- weekday = theNextWeekOfRecurrences.weekday(dayOfWeekNum);
69
+ weekday = theNextWeekOfRecurrences.set({ weekday: dayOfWeekNum as WeekdayNumbers });
74
70
  if (weekday > recurrenceEnds || weekday < beginningDateTime) {
75
71
  continue; // Continue because repeatOnDays isn't sorted by the day of the week
76
72
  }
@@ -85,21 +81,22 @@ function getWeeklyRecurringDates(beginningDateTime: Dayjs, recurrence: Recurrenc
85
81
  return recurrenceDates;
86
82
  }
87
83
 
88
- function copyTimeToDate(dateWithTimeToCopy: Dayjs, dateWhoseTimeToChange: Dayjs): Dayjs {
89
- if (dateWithTimeToCopy.second() !== 0) {
84
+ function copyTimeToDate(dateWithTimeToCopy: DateTime, dateWhoseTimeToChange: DateTime): DateTime {
85
+ if (dateWithTimeToCopy.second !== 0) {
90
86
  console.warn(`dateWithTimeToCopy has non-zero seconds: ${dateWithTimeToCopy.toString()} \nFixing...`);
91
- dateWithTimeToCopy = dateWithTimeToCopy.set('seconds', 0);
87
+ dateWithTimeToCopy = dateWithTimeToCopy.set({second: 0});
92
88
  }
93
- dateWhoseTimeToChange = dateWhoseTimeToChange.set('hours', dateWithTimeToCopy.hour());
94
- dateWhoseTimeToChange = dateWhoseTimeToChange.set('minutes', dateWithTimeToCopy.minute());
95
- dateWhoseTimeToChange = dateWhoseTimeToChange.set('seconds', 0); // Should be 0
96
- return dateWhoseTimeToChange;
89
+ return dateWhoseTimeToChange.set({
90
+ hour: dateWithTimeToCopy.hour,
91
+ minute: dateWithTimeToCopy.minute,
92
+ second: 0
93
+ });
97
94
  }
98
95
 
99
96
  function dayOfWeekEnumToDayNumber(dayEnum: DayOfWeek): number {
100
97
  switch (dayEnum) {
101
98
  case DayOfWeek.Sunday:
102
- return 0;
99
+ return 7; // Luxon uses 1-7 where 7 is Sunday
103
100
  case DayOfWeek.Monday:
104
101
  return 1;
105
102
  case DayOfWeek.Tuesday:
@@ -122,13 +119,13 @@ function dayOfWeekEnumToDayNumber(dayEnum: DayOfWeek): number {
122
119
  * @param date
123
120
  * @param interval
124
121
  */
125
- function getBeginningOfWeekInterval(date: Dayjs, interval: number): Dayjs {
122
+ function getBeginningOfWeekInterval(date: DateTime, interval: number): DateTime {
126
123
  if (!interval) {
127
124
  interval = 1; // Avoid 0
128
125
  }
129
126
  // An interval of 2 would be (2 - 1) * 7 + 1 = 8 days to add to skip a week and go into the next week
130
127
  const numberOfDaysToAdd = interval > 1 ? (interval - 1) * 7 + 1 : 1;
131
- return date.endOf('week').add(numberOfDaysToAdd, 'day');
128
+ return date.endOf('week').plus({ days: numberOfDaysToAdd });
132
129
  }
133
130
 
134
131
  export function freqToGrammarString(freq: RecurringFrequency, interval: number | undefined, toLowerCase: boolean = false): string {
@@ -154,18 +151,18 @@ export function freqToGrammarString(freq: RecurringFrequency, interval: number |
154
151
  return toLowerCase ? result.toLowerCase() : result;
155
152
  }
156
153
 
157
- export function findEarliestPossibleBashEventDate(startDateTimeArg: DateTimeArgType): Dayjs | undefined {
154
+ export function findEarliestPossibleBashEventDate(startDateTimeArg: DateTimeArgType): DateTime | undefined {
158
155
  return findEarliestOrLatestPossibleBashEventDate(startDateTimeArg, true);
159
156
  }
160
157
 
161
- function findEarliestOrLatestPossibleBashEventDate(startDateTimeArg: DateTimeArgType, findEarly: boolean): Dayjs | undefined {
158
+ function findEarliestOrLatestPossibleBashEventDate(startDateTimeArg: DateTimeArgType, findEarly: boolean): DateTime | undefined {
162
159
  if (!startDateTimeArg) {
163
160
  return;
164
161
  }
165
162
  // Don't allow dates before the current date
166
- const startDateTime = dayjs(startDateTimeArg);
167
- const currentDateTime = dayjs();
168
- const comparedDateTime = compareDateTime(currentDateTime.toDate(), startDateTimeArg);
163
+ const startDateTime = DateTime.fromJSDate(new Date(startDateTimeArg));
164
+ const currentDateTime = DateTime.local();
165
+ const comparedDateTime = compareDateTime(currentDateTime.toJSDate(), startDateTimeArg);
169
166
  if (findEarly) {
170
167
  return comparedDateTime > 0 ? currentDateTime : startDateTime;
171
168
  }
@@ -1,10 +1,10 @@
1
- import dayjs from "dayjs";
1
+ import { DateTime } from "luxon";
2
2
  import {
3
- NumberOfTicketsForDate,
4
- URL_PARAMS_NUMBER_OF_TICKETS_TICKETS_DATE_DELIM,
5
- URL_PARAMS_TICKET_TIER_ID_NUMBER_OF_TICKETS_DATE_DELIM,
6
- URL_PARAMS_TICKET_LIST_DELIM,
7
- URL_PARAMS_TICKETS_DATE_DELIM
3
+ NumberOfTicketsForDate,
4
+ URL_PARAMS_NUMBER_OF_TICKETS_TICKETS_DATE_DELIM,
5
+ URL_PARAMS_TICKET_LIST_DELIM,
6
+ URL_PARAMS_TICKET_TIER_ID_NUMBER_OF_TICKETS_DATE_DELIM,
7
+ URL_PARAMS_TICKETS_DATE_DELIM
8
8
  } from "../definitions";
9
9
  import { DATETIME_FORMAT_ISO_LIKE } from "./dateTimeUtils";
10
10
 
@@ -60,11 +60,11 @@ export function ticketListStrToTicketList(ticketListStr: string): Map<string, Nu
60
60
  for (const ticketNumAndDateStr of ticketNumAndDates) {
61
61
  // [numberOfTickets];;[date]
62
62
  const [numberOfTickets, ticketDateTimeStr] = ticketNumAndDateStr.split(URL_PARAMS_TICKETS_DATE_DELIM);
63
- const ticketDateTime = dayjs(ticketDateTimeStr);
63
+ const ticketDateTime = DateTime.fromISO(ticketDateTimeStr);
64
64
  let ticketDateTimeFormattedStr: string | undefined = undefined;
65
65
 
66
- if (ticketDateTime.isValid()) {
67
- ticketDateTimeFormattedStr = ticketDateTime.format(DATETIME_FORMAT_ISO_LIKE);
66
+ if (ticketDateTime.isValid) {
67
+ ticketDateTimeFormattedStr = ticketDateTime.toFormat(DATETIME_FORMAT_ISO_LIKE);
68
68
  }
69
69
 
70
70
  ticketNumAndDatesArr.push({