Skip to content

Sondre/web 60 opening hours closed specific days#2096

Open
Erichseen wants to merge 10 commits intomasterfrom
Sondre/web-60-opening-hours-closed-specific-days
Open

Sondre/web 60 opening hours closed specific days#2096
Erichseen wants to merge 10 commits intomasterfrom
Sondre/web-60-opening-hours-closed-specific-days

Conversation

@Erichseen
Copy link
Copy Markdown
Contributor

@Erichseen Erichseen commented Mar 4, 2026

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

@Erichseen Erichseen force-pushed the Sondre/web-60-opening-hours-closed-specific-days branch from d3c0dd9 to fab456e Compare March 4, 2026 19:54
@Erichseen Erichseen self-assigned this Mar 4, 2026
Copy link
Copy Markdown
Contributor

@eilifhl eilifhl left a comment

Choose a reason for hiding this comment

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

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

@Erichseen
Copy link
Copy Markdown
Contributor Author

Erichseen commented Mar 5, 2026

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!

@andsamfu
Copy link
Copy Markdown
Contributor

Likte godt designet på den nye oversikten!

Hva med å aligne lokal navnet med teksten under:
image

Slik som ved dagens oversikt:
image

Ser at pipeline sier at du har merge conflicts. Gjerne fiks det, og så kan jeg se videre på PR-en.

Sondre Erichsen added 10 commits March 11, 2026 12:08
- 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
@Erichseen Erichseen force-pushed the Sondre/web-60-opening-hours-closed-specific-days branch from 2c38974 to 12aef03 Compare March 11, 2026 11:29
@Erichseen
Copy link
Copy Markdown
Contributor Author

Likte godt designet på den nye oversikten!

Hva med å aligne lokal navnet med teksten under: image

Slik som ved dagens oversikt: image

Ser at pipeline sier at du har merge conflicts. Gjerne fiks det, og så kan jeg se videre på PR-en.

Likte godt designet på den nye oversikten!

Hva med å aligne lokal navnet med teksten under: image

Slik som ved dagens oversikt: image

Ser at pipeline sier at du har merge conflicts. Gjerne fiks det, og så kan jeg se videre på PR-en.

Styling og merge conflict fiksa

@aTrueYety
Copy link
Copy Markdown
Contributor

Can you add some text in the controll panel that describes to the admin that the day changes at 04:00?

Comment thread frontend/src/dto.ts
is_open_thursday: boolean;
is_open_friday: boolean;
is_open_saturday: boolean;
is_open_sunday: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hvorfor er disse ikke valgfrie men opening og closing er det?

Copy link
Copy Markdown
Contributor

@aTrueYety aTrueYety left a comment

Choose a reason for hiding this comment

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

this a bog boy pr holyyyy

Comment thread frontend/src/utils.ts
* 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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Navnet her er litt forvirrende. Få frem at den henter venueSchedule for i dag?

Comment thread frontend/src/utils.ts
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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Kan bruke date-fns sin addDays her, litt cleanere

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.

5 participants