Skip to content

refactor: standardize date objects across project#472

Open
akselmat wants to merge 1 commit into
mainfrom
refactor/standardize-date-objects
Open

refactor: standardize date objects across project#472
akselmat wants to merge 1 commit into
mainfrom
refactor/standardize-date-objects

Conversation

@akselmat
Copy link
Copy Markdown

Switch period/applicant/committee date fields from string to BSON Date end-to-end. Adds parseDates helpers for client-side conversion, migration scripts (in-place and aggregation-based), and fixes the formatter, validator, and schedule-rendering paths that broke when the types flipped.

Switch period/applicant/committee date fields from string to BSON Date
end-to-end. Adds parseDates helpers for client-side conversion, migration
scripts (in-place and aggregation-based), and fixes the formatter,
validator, and schedule-rendering paths that broke when the types flipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
online-opptak Ready Ready Preview, Comment Apr 30, 2026 8:52am
opptaksside-matching Ready Ready Preview, Comment Apr 30, 2026 8:52am

Request Review

@akselmat akselmat requested a review from jorgengaldal April 30, 2026 08:53
start: new Date(at.start).toISOString(),
end: new Date(at.end).toISOString(),
start: at.start instanceof Date ? at.start.toISOString() : at.start,
end: at.end instanceof Date ? at.end.toISOString() : at.end,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hvorfor trengs denne sjekken her? Vil jo helst at den alltid skal være instanceof Date

weekDates[date].push({ start: slot.start, end: slot.end });
if (slot?.start && slot?.end) {
const start = new Date(slot.start as unknown as string | number | Date);
const end = new Date(slot.end as unknown as string | number | Date);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tilsvarende her

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants