diff --git a/packages/backend/migrations/20231121215558_roster_participants.ts b/packages/backend/migrations/20231121215558_roster_participants.ts index 41c7d52b..c70b040d 100644 --- a/packages/backend/migrations/20231121215558_roster_participants.ts +++ b/packages/backend/migrations/20231121215558_roster_participants.ts @@ -13,8 +13,8 @@ export async function up(knex: Knex): Promise { table.boolean('extraTickets'); table.integer('yearsAttended'); table.json('yearsAtCamp'); - table.date('estimatedArrivalDate'); - table.date('estimatedDepartureDate'); + table.timestamp('estimatedArrivalDate', { useTz: false }).notNullable(); + table.timestamp('estimatedDepartureDate', { useTz: false }).notNullable(); table.string('sleepingArrangement'); table.boolean('earlyArrivalInterest'); table.boolean('postBurnInterest'); diff --git a/packages/backend/models/roster_participant/roster_participant.ts b/packages/backend/models/roster_participant/roster_participant.ts index cdc6634f..363b271c 100644 --- a/packages/backend/models/roster_participant/roster_participant.ts +++ b/packages/backend/models/roster_participant/roster_participant.ts @@ -65,7 +65,7 @@ export default class RosterParticipant extends Model { }, estimatedDepartureDate: { 'ui:description': - 'In-camp MANDATORY tear-down occurs at least until 4p on Sunday, September 3th, so it best not be before then.', + 'In-camp MANDATORY tear-down occurs at least until 4p on Sunday, September 1st, so it best not be before then.', }, }; diff --git a/packages/backend/routes/roster_participants.ts b/packages/backend/routes/roster_participants.ts index 612663b1..76bc3559 100644 --- a/packages/backend/routes/roster_participants.ts +++ b/packages/backend/routes/roster_participants.ts @@ -1,4 +1,5 @@ import express, { Request, Response, Router } from 'express'; +import { DateTime } from 'luxon'; import User from '../models/user/user'; import RosterParticipant from '../models/roster_participant/roster_participant'; import hasPermission from '../middleware/rbac'; @@ -50,12 +51,28 @@ router.post('/:id', async (req: Request, res: Response) => { const checkCurrent = await RosterParticipant.query().where(signupScope); + const parsedArrivalDate = DateTime.fromJSDate( + new Date(proposedRosterParticipant.estimatedArrivalDate), + ) + .setZone('America/Los_Angeles', { keepLocalTime: true }) + .toUTC() + .toJSDate(); + + const parsedDepartureDate = DateTime.fromJSDate( + new Date(proposedRosterParticipant.estimatedDepartureDate), + ) + .setZone('America/Los_Angeles', { keepLocalTime: true }) + .toUTC() + .toJSDate(); + if (checkCurrent.length > 0) { delete req.body.id; await RosterParticipant.query() .where(signupScope) .patch({ ...req.body, + estimatedArrivalDate: parsedArrivalDate, + estimatedDepartureDate: parsedDepartureDate, yearsAtCamp: JSON.stringify(proposedRosterParticipant.yearsAtCamp), }); diff --git a/packages/frontend/src/components/RosterTable.tsx b/packages/frontend/src/components/RosterTable.tsx index 960123d1..5d33630e 100644 --- a/packages/frontend/src/components/RosterTable.tsx +++ b/packages/frontend/src/components/RosterTable.tsx @@ -49,6 +49,7 @@ function RosterTable() { Referral Name Sleeping Arrangement Estimated Arrival + Estimated Departure Skills Interested in EA Interested in Post Burn @@ -101,6 +102,11 @@ function RosterTable() { new Date(participant.rosterParticipant.estimatedArrivalDate), )} + + {BurningManDateFormatter.format( + new Date(participant.rosterParticipant.estimatedDepartureDate), + )} + {skillsString(participant.user.skillsOfNote)}, {participant.user.skillsNotInList}