@@ -437,6 +437,7 @@ function openEditEntryModal(entry: WaitlistEntry): void {
437
437
438
438
function saveEntry(): void {
439
439
const now = new Date ()
440
+ const formattedDate = ` ${now .getFullYear ()}-${String (now .getMonth () + 1 ).padStart (2 , ' 0' )}-${String (now .getDate ()).padStart (2 , ' 0' )} `
440
441
const entry: WaitlistEntry = {
441
442
id: isEditMode .value && currentEntry .value ? currentEntry .value .id : Math .max (0 , ... waitlistEntries .value .map (e => e .id )) + 1 ,
442
443
name: entryName .value ,
@@ -447,7 +448,7 @@ function saveEntry(): void {
447
448
notificationPreference: entryNotificationPreference .value ,
448
449
notes: entryNotes .value || null ,
449
450
status: ' Waiting' ,
450
- dateAdded: now . toISOString (). split ( ' T ' )[ 0 ] ,
451
+ dateAdded: formattedDate ,
451
452
notified: false ,
452
453
priority: entryPriority .value ,
453
454
lastNotified: null ,
@@ -969,7 +970,7 @@ function updateCharts(): void {
969
970
})
970
971
971
972
chart .data .labels = partySizes .map (size => ` ${size } ${size === 1 ? ' unit' : ' units' } ` )
972
- if (chart .data .datasets && chart . data . datasets . length > 0 ) {
973
+ if (chart .data .datasets ?.[ 0 ] ) {
973
974
chart .data .datasets [0 ].data = partySizeCounts
974
975
}
975
976
chart .update ()
@@ -979,7 +980,7 @@ function updateCharts(): void {
979
980
const chart = sourceChart as Chart <' doughnut' >
980
981
const sourceLabels = sources .slice (1 )
981
982
chart .data .labels = sourceLabels
982
- if (chart .data .datasets && chart . data . datasets . length > 0 ) {
983
+ if (chart .data .datasets ?.[ 0 ] ) {
983
984
chart .data .datasets [0 ].data = sourceLabels .map (source =>
984
985
waitlistEntries .value .filter (entry =>
985
986
entry .source ? entry .source === source : false
@@ -993,7 +994,7 @@ function updateCharts(): void {
993
994
const chart = statusChart as Chart <' pie' >
994
995
const statusLabels = statuses .slice (1 )
995
996
chart .data .labels = statusLabels
996
- if (chart .data .datasets && chart . data . datasets . length > 0 ) {
997
+ if (chart .data .datasets ?.[ 0 ] ) {
997
998
chart .data .datasets [0 ].data = statusLabels .map (status =>
998
999
waitlistEntries .value .filter (entry => entry .status === status ).length
999
1000
)
@@ -1005,7 +1006,7 @@ function updateCharts(): void {
1005
1006
const chart = trendChart as Chart <' line' >
1006
1007
const dates = trendData .value .map (d => d .date )
1007
1008
chart .data .labels = dates
1008
- if (chart .data .datasets && chart . data . datasets . length > 0 ) {
1009
+ if (chart .data .datasets ?.[ 0 ] ) {
1009
1010
chart .data .datasets [0 ].data = trendData .value .map (d => d .count )
1010
1011
}
1011
1012
chart .update ()
0 commit comments