Can't create event on Sunday even when open

Created on 29 May 2020, about 4 years ago
Updated 16 April 2024, 2 months ago

We've got "Open Hours" set for Sunday, but when attempting to create a reservation on Sunday, the user gets the error:

Please select start and end times within the opening hours.

This is because AddReservationForm::validateForm() uses the delta value of the field to compare against $start_date->format('N') to find the right day to look at. The ISO-8601 day of the week for Sunday is 7 while the "Open Hours" for Sunday uses delta "0". So, it never finds any open hours for Sunday.

We could fix this by either:

  1. Converting the "Open Hours" values in delta 0 to a delta of 7.
  2. Changing the value of $start_date->format('N') in two comparisons to use 0 when it actually equals 7.

Patch to follow that does the first.

🐛 Bug report
Status

Postponed: needs info

Component

Code

Created by

🇺🇸United States jrb Raleigh-Durham Area, NC, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024