From ae3b5b04c9eae1f81ef0e6ede0d4d56c592b493d Mon Sep 17 00:00:00 2001 From: Johnny Tan Date: Wed, 30 Apr 2025 13:08:05 -0400 Subject: [PATCH 1/2] Fix offset on admin dashboard --- package-lock.json | 27 ++++++++++++++++++--------- src/app/private/page.tsx | 24 +++++++++++------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index af83f48..cbaec6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2551,9 +2551,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2934,9 +2934,12 @@ } }, "node_modules/date-fns-jalali": { - "version": "4.1.0-0", - "resolved": "https://registry.npmjs.org/date-fns-jalali/-/date-fns-jalali-4.1.0-0.tgz", - "integrity": "sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==" + "version": "4.0.0-0", + "resolved": "https://registry.npmjs.org/date-fns-jalali/-/date-fns-jalali-4.0.0-0.tgz", + "integrity": "sha512-EczB+gWceuWCRlacE4T+WmdP+BV/IUQpjQW9aBa9DNcXkKuZFv3WBDqeP2Ew+6YFBtPRRcH5U22+C6gcpwgG8A==", + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/debug": { "version": "4.4.0", @@ -4048,9 +4051,9 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -6334,6 +6337,12 @@ "react": ">=16.8.0" } }, + "node_modules/react-day-picker/node_modules/date-fns-jalali": { + "version": "4.1.0-0", + "resolved": "https://registry.npmjs.org/date-fns-jalali/-/date-fns-jalali-4.1.0-0.tgz", + "integrity": "sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==", + "license": "MIT" + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", diff --git a/src/app/private/page.tsx b/src/app/private/page.tsx index d2d3a6b..a5b432a 100644 --- a/src/app/private/page.tsx +++ b/src/app/private/page.tsx @@ -69,7 +69,7 @@ export default function HomePage() { [key: string]: { start: string; end: string; title?: string }; } = {}; - for (let i = 1; i <= daysAhead; i++) { + for (let i = 0; i < daysAhead; i++) { const date = new Date(today); date.setDate(today.getDate() + i); @@ -79,7 +79,7 @@ export default function HomePage() { try { const customDayDate = new Date(today); - customDayDate.setDate(today.getDate() + i - 1); + customDayDate.setDate(today.getDate() + i); const customDayRes = await getCustomDay(customDayDate); @@ -311,16 +311,14 @@ export default function HomePage() { {sortedReadableTimeSlots(Object.keys(dayUsers)) .slice(0, 3) .map((dateString) => { - const displayDate = new Date(dateString).toLocaleDateString( - "en-US", - { - weekday: "long", - month: "long", - day: "numeric", - year: "numeric", - } - ); - + const date = new Date(dateString); + date.setDate(date.getDate() + 1); + const displayDate = date.toLocaleDateString("en-US", { + weekday: "long", + month: "long", + day: "numeric", + year: "numeric", + }); const formatTime = (time: string) => { if (!time) return ""; const [hourStr, minute] = time.split(":"); @@ -355,7 +353,7 @@ export default function HomePage() { actionButton={cardButton(() => { router.push( `/private/events?date=${getStandardDateString( - new Date(dateString) + new Date(displayDate) )}` ); })} From 0d0ead532d39a3574109a89230f59244c3d482a4 Mon Sep 17 00:00:00 2001 From: Johnny Tan Date: Wed, 30 Apr 2025 13:11:39 -0400 Subject: [PATCH 2/2] Co-authored-by: Won Kim --- src/app/private/events/page.tsx | 2 +- src/components/VolunteerTable.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/private/events/page.tsx b/src/app/private/events/page.tsx index 3f984e7..4139405 100644 --- a/src/app/private/events/page.tsx +++ b/src/app/private/events/page.tsx @@ -655,7 +655,7 @@ export default function EventsPage() {
Total Individual Signups: {individuals.length}{" "} {individuals.length === 1 ? "volunteer" : "volunteers"} /{" "} - {customDayCapacity}{" "} + Capacity: {customDayCapacity}{" "} {customDayCapacity === 1 ? "volunteer" : "volunteers"}
diff --git a/src/components/VolunteerTable.tsx b/src/components/VolunteerTable.tsx index c60a10f..2427bb1 100644 --- a/src/components/VolunteerTable.tsx +++ b/src/components/VolunteerTable.tsx @@ -192,7 +192,7 @@ export default function VolunteerTable({ }} > {fromAttendeePage - ? `Time(s) ${showOrganizationName ? "and Group Size" : null}` + ? `Time(s) ${showOrganizationName ? "and Group Size" : ""}` : "Hours Volunteered"} - {format(start)} - {format(end)} ( - {slot.numVolunteers}) + {format(start)} - {format(end)}{" "} + {showOrganizationName + ? `(${slot.numVolunteers})` + : ""} ); })