Sondre/web 60 opening hours closed specific days#2096
Sondre/web 60 opening hours closed specific days#2096
Conversation
d3c0dd9 to
fab456e
Compare
eilifhl
left a comment
There was a problem hiding this comment.
Ville kanskje lagt til en slags disclaimer om at forhåndsvisningen i AdminPanelet bare gjelder dagen i dag, og kanskje (i fremtiden?) en mulighet til å endre dagen på forhåndsvisning.
Men veldig fin løsning! bedre enn min funky ass løsning lmao
Tenkte nok å fjerne den før jeg merger! |
- Add BooleanField for each day of the week to Venue model - Update open_venues API to filter by is_open_* instead of midnight convention - Add 4-hour offset comment linking to frontend
- Add 7 is_open_* boolean fields to VenueDto type - Remove unused OpenVenuesDto type
- Add disabled prop support to time inputs - Add className forwarding for styling flexibility - Improve dark mode styling
- Add getVenueDate() and getVenueDay() with 4-hour offset logic - Add getVenueDaySchedule() for centralized per-day field access - Add getVenueScheduleISO() for proper overnight time handling
- OpeningHoursContainer: use getVenues + client-side filtering - Remove getOpenVenues API function and venueKeys.open() - Update OpeningHours component with getVenueScheduleISO for time display - Update stories with is_open_* fields and closed days
- Extract VenueOpeningHoursBox component for cleaner separation - Add Checkbox component integration for each day - Add optimistic updates with rollback on mutation error - Refactor to use getVenueDaySchedule utility - Improve dark mode support
- Add common_day, common_from, common_to translation keys
- Add empty line between @use statements in Checkbox.module.scss - Reorder SCSS selectors to fix descending-specificity rule - Remove empty lines before declarations in OpeningHoursAdminPage.module.scss - Update test_open_venues_filtering to set is_open_* fields explicitly
2c38974 to
12aef03
Compare
|
Can you add some text in the controll panel that describes to the admin that the day changes at 04:00? |
| is_open_thursday: boolean; | ||
| is_open_friday: boolean; | ||
| is_open_saturday: boolean; | ||
| is_open_sunday: boolean; |
There was a problem hiding this comment.
Hvorfor er disse ikke valgfrie men opening og closing er det?
aTrueYety
left a comment
There was a problem hiding this comment.
this a bog boy pr holyyyy
| * Returns ISO date strings for a venue's schedule on the current venue day. | ||
| * Handles overnight hours (e.g., 22:00-02:00) by adding a day to the end time. | ||
| */ | ||
| export function getVenueScheduleISO(venue: VenueDto): VenueScheduleISO { |
There was a problem hiding this comment.
Navnet her er litt forvirrende. Få frem at den henter venueSchedule for i dag?
| const [closeHour, closeMin] = closing.split(':').map(Number); | ||
| const isOvernight = closeHour < openHour || (closeHour === openHour && closeMin <= openMin); | ||
|
|
||
| const endDate = isOvernight ? new Date(startDate.getTime() + 24 * 60 * 60 * 1000) : startDate; |
There was a problem hiding this comment.
Kan bruke date-fns sin addDays her, litt cleanere




Adds is_open_* boolean fields to Venue model for marking
specific days as closed
Filtering moved from backend (open_venues endpoint) to
frontend (in OpeningHoursContainer.tsx) so the same view can be used for other venue-time components as well.
TEMP commit: this commit is a live preview of today's hours
at top of admin page for testing. Remove before merge