This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

opening_hours differs on even / odd days?

3
1

It is very common in some countries that some amenities changes workhours on alternating days (so one day the work in the morning, the next in the evening).

So for example on even days (like 2.Jan or 18.Jun etc.) they will work only in the morning (for example 08:00-13:00), while on odd days (like 7.Mar or 31.Oct etc.) the will work only in the evening (for example 14:00-19:00).

While it is simple schedule in practice, looking at the https://wiki.openstreetmap.org/wiki/Key:opening_hours I cannot seem to figure out how to map it. Any ideas?

asked 27 Dec '19, 18:08

Matija%20Nalis's gravatar image

Matija Nalis
7502916
accept rate: 11%

I presume you are looking for a solution other than by brute force listing all the odd days there could be in a month?

(27 Dec '19, 20:20) InsertUser

@InsertUser yes, that is correct assumption - listing half of days in a year one by one would be terrible (even if it actually worked, which I'm sceptical about due to extreme length of the field in such a case)... I was hoping for something like week 2-53/2 10:00-20:00 but for even days instead of even weeks

(27 Dec '19, 22:12) Matija Nalis
3

No expert on this , but you should be able to do something like 02-30/2 08:00-13:00; 01-31/2 14:00-19:00. I have no idea what happens to evaluation if you then introduce month or week ranges as well or, for that matter, days of the week. However, this does not seem to properly specified so there is probably no implementation (see https://github.com/opening-hours/opening_hours.js/issues/252)

(28 Dec '19, 10:15) SK53 ♦

@SK53 thanks for the reference! Unfortunately, as you say at this time it does not seem to be implemented in https://openingh.openstreetmap.de/evaluation_tool/ nor elsewhere I looked :(

(30 Dec '19, 22:13) Matija Nalis

Source code available on GitHub .