I’m finding myself in a bit of an awkward situation with opening hours, where I can’t seem to be able to tag a relatively common situation in a way that results in a proper output.
The situation is as follows:
I have a bus line that runs Monday to Friday from 05:00 to 25:00 and Saturday and Sunday from 06:00 to 24:30. On public holidays, the bus line runs according to the weekend schedule, i.e. from 06:00 to 24:30.
Where this becomes problematic is that I can’t seem to model this properly considering the way that public transit operations have the concept of a “service day” that doesn’t necessarily start and end at midnight.
This means that:
If a holiday falls on a Monday (Such as Labour Day here in Canada, which falls on Monday, September 7th this year):
1.Service from the previous day (Sunday) ends at 00:30 on Monday;
2. The day’s service (on the Monday that is a holiday) starts at 06:00 on Monday;
3. The day’s service (on the Monday that is a holiday) ends at 00:30 on Tuesday;
If the holiday falls on a weekday other than Monday (for instance, on a Thursday, like New Year’s 2026)
Service from the previous day (Wednesday, so weekday schedule) ends at 01:00 on Thursday;
The day’s service (on the Thursday that is a holiday) starts at 06:00 on Thursday;
The day’s service (on the Thursday that is a holiday) ends at 00:30 on Friday.
If I tag opening_hours = Mo-Fr 05:00-25:00; Sa-Su,PH 06:00-24:30 (using a semicolon to separate the rules)
The previous day’s service correctly ends at 00:30 on Monday (1.1);
The day’s service correctly starts at 06:00 on Monday (1.2);
The day’s service incorrectly ends at 01:00 on Tuesday. It should end at 00:30 on Tuesday (1.3).
If the holiday falls on another weekday, like New Year’s 2026, on a Thursday
The previous day’s service incorrectly ends at 00:30 on Thursday. It should end at 01:00 on Thursday (2.1);
The day’s service correctly starts at 06:00 on Thursday (2.2)
The day’s service incorrectly ends at 01:00 on Friday. It should end at 00:30 on Friday (2.3).
Additionally, this tagging results in regular Friday service incorrectly ending at 24:00 on Friday / 00:00 on Saturday, when it should end at 01:00 on Friday
Otherwise, if I tag opening_hours = Mo-Fr 05:00-25:00, Sa-Su,PH 06:00-24:30 (using a comma to separate the rules), the issues previously described are resolved. However, this results in a new issue: an “additional” opening period is added to holidays between 05:00 and 06:00, seemingly because the holiday is on a weekday and because normally, service starts at 05:00 on Weekdays.
What would be the correct way to indicate opening hours in this situation?
This doesn’t quite work, because it results in the previous day’s service ending at 00:00, which is incorrect. It should either end at 00:30 (if the previous day was a Sunday) or at 01:00 (if the previous day was a weekday)
This is a good idea, but it doesn’t quite solve the issue of the previous day’s service ending at the incorrect time (and that end time is variable depending on if the previous day was a weekday or a weekend).
That wouldn’t solve the problem. We would need rules in the style of “if the day after the holiday is a Tuesday, then the following time applies”. This already exists: PH +1 day, Tu 00:00-00:30
This should be the complete rule: Su-Mo 00:00-00:30,06:00-24:00; Tu-Sa 00:00-01:00,06:00-24:00; PH Mo 00:00-00:30,06:00-24:00; PH +1 day Tu 00:00-00:30,06:00-24:00; PH Tu-Su 00:00-00:30,06:00-24:00; PH +1 day We-Mo 00:00-00:30,06:00-24:00