OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

Announcement

A fix has been applied to the login system for the forums - if you have trouble logging in please contact support@openstreetmap.org with both your forum username and your OpenStreetMap username so we can make sure your accounts are properly linked.

#1 2017-09-05 12:50:39

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

open_hours: closed the last day of each month ???

I can't find how to denote that a spot is closed the last day of each month

Any idea?

Offline

#2 2017-09-05 13:27:51

BCNorwich
Member
From: Norwich, Norfolk, UK
Registered: 2010-07-31
Posts: 83

Re: open_hours: closed the last day of each month ???

Hi,

opening_hours=closed "Closed on the last day in the month"

Above should work with open times placed before the closed limiter.
Please see paragraph "Closed on last weekend in month" on webpage :- https://wiki.openstreetmap.org/wiki/Tal … ning_hours

Offline

#3 2017-09-05 15:16:58

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

BCNorwich wrote:

opening_hours=closed "Closed on the last day in the month"

I don't think that's a solution. How is an application supposed to parse that to show spots open right now?

Offline

#4 2017-09-05 15:18:01

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

By the way, I tried
-1 off
and got an error on JOSM:
Unexpected token: "-" Invalid/unsupported syntax

Offline

#5 2017-09-06 11:14:51

escada
Moderator
Registered: 2011-08-13
Posts: 1,194

Re: open_hours: closed the last day of each month ???

The only thing that seems to work for http://openingh.openstreetmap.de/evaluation_tool/ is

open; PH open;Jan 31, Mar 31,May 31, Jul 31, Aug 31, Oct 31, Dec 31, Apr 30, Jun 30, Sep 30, Nov 30, Feb 28 off; Feb 29 off

which is not correct for February.

[Edit changed Feb dates]

Offline

#6 2017-09-06 22:06:47

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

I opted for
-1 off
inspite of the JOSM complaint, since it's mentioned in the specification of opening_hours

Offline

#7 2017-09-07 00:55:50

muralito
Member
Registered: 2012-09-04
Posts: 1,459

Re: open_hours: closed the last day of each month ???

vvoovv wrote:

I opted for
-1 off
inspite of the JOSM complaint, since it's mentioned in the specification of opening_hours

The string

-1 off

is not valid for the syntax defined in https://wiki.openstreetmap.org/wiki/Key … cification, so JOSM complains and most probably other apps are unable to undestand what you are trying to write.

Offline

#8 2017-09-07 08:19:52

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

I refer to the main article for opening_hours

-1 off should be correct according to the quote from there:

Syntax for specifying dates (with optional times)
dates: monthly | weekly | daily | variably | holidays
monthly: monthdays [   weekdays ]
monthdays: dd [ -dd ]
dd: a 2-digit monthday number in range 01-31, e.g. Dec 25

Last edited by vvoovv (2017-09-07 08:20:09)

Offline

#9 2017-09-07 10:55:18

hadw
Member
Registered: 2014-09-02
Posts: 640

Re: open_hours: closed the last day of each month ???

That quote says that the only use of "-" is to delimit the end from the beginning of the range, and also that "1" should be represented as "01", so it DOES NOT support the  use of "-1".

Offline

#10 2017-09-07 20:01:31

ypid
Member
From: BW, Germany, Earth, Milky Way
Registered: 2013-10-10
Posts: 67
Website

Re: open_hours: closed the last day of each month ???

Hey

There is currently no easy syntax defined to express this. I noticed this already and included it in the TODO of the evaluation_tool/lib. Someone would need to some up with a good saytax and do a proposal so that we have a standard for this.

I would propose something like

opening_hours=monthday -1 off "Closed on the last day each month"
opening_hours=monthday 1 off "Closed on the first day each month"

The `monthday` is a keyword followed by a list of monthdays. Similar elements already exist in the syntax which also start with a keyword like `week` or `comment`.

What happens if there is no such monthday for a month? I would say then the rule does not match for this month. That is just an idea.

Last edited by ypid (2017-09-07 20:05:37)

Offline

#11 2017-09-08 09:33:26

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

ypid,

Is the sentence "Closed on the last day each month" necessary?

Offline

#12 2017-09-09 15:22:22

ypid
Member
From: BW, Germany, Earth, Milky Way
Registered: 2013-10-10
Posts: 67
Website

Re: open_hours: closed the last day of each month ???

Good question and sorry for the ambiguity. No, they are normal comments in the opening_hours syntax which I just reused/misused here.

This would be enough:

opening_hours=monthday -1 off
opening_hours=monthday 1 off

Offline

#13 2017-09-09 16:04:20

SimonPoole
Member
Registered: 2010-03-14
Posts: 1,360

Re: open_hours: closed the last day of each month ???

Oh no, not again.

Anyway, we already have a syntax for month day numeric values: http://wiki.openstreetmap.org/wiki/Key: … ion#daynum please don't confuse things by introducing yet another way of specifying them.

Further, there are other ways of approaching this outside of introducing a completely new grammar element, just to handle one special case.

For example create a special wildcard month, then it the value could be written as
opening_hours=EveryMonth 01 -1 day off

If the grammar allowed a month range plus a month day spec, it wouldn't even need that

opening_hours=Jan-Dec 01 -1 day off

that would need to be checked if it doesn't conflict with anything else.

@ypid the evaluator currently barfs on "Mar 03-Dec 01 -1 day off" which is however completely valid

PS: just in case that it wasn't obvious, the correct way to express the last day of month closed for all months without any grammar changes is

Jan 01 - 1 day off; Feb 01 -1 day off; Mar 01 -1 day off; Apr 01 -1 day off; May 01 -1 day off; Jun 01 -1 day off; Jul 01 -1 day off; Aug 01 -1 day off; Sep 01 -1 day off; Oct 01 -1 day off; Nov 01 -1 day off; Dec 01 -1 day off

Last edited by SimonPoole (2017-09-12 11:29:31)

Offline

#14 2017-09-13 20:48:59

ypid
Member
From: BW, Germany, Earth, Milky Way
Registered: 2013-10-10
Posts: 67
Website

Re: open_hours: closed the last day of each month ???

Thanks very much! I prefer your

opening_hours=Jan-Dec 01 -1 day off

I must have overlooked that ` -1 day` can already be used to express this. Very nice. I am not completely sure that this extension of the syntax would not break anything but it sounds promising.


SimonPoole wrote:

Jan 01 - 1 day off; Feb 01 -1 day off; Mar 01 -1 day off; Apr 01 -1 day off; May 01 -1 day off; Jun 01 -1 day off; Jul 01 -1 day off; Aug 01 -1 day off; Sep 01 -1 day off; Oct 01 -1 day off; Nov 01 -1 day off; Dec 01 -1 day off

Nice, I missed that smile Multiple <monthday_range> (s) can even be combined using a comma. So

Jan 01 - 1 day,Feb 01 -1 day,Mar 01 -1 day,Apr 01 -1 day,May 01 -1 day,Jun 01 -1 day,Jul 01 -1 day,Aug 01 -1 day,Sep 01 -1 day,Oct 01 -1 day,Nov 01 -1 day,Dec 01 -1 day open

should also work. The evaluation tool does not yet implement it. https://github.com/opening-hours/openin … /issues/25 Sorry for this to take so long.

Offline

#15 2017-09-13 21:24:05

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

SimonPoole wrote:

opening_hours=EveryMonth 01 -1 day off

I'd prefer that kind of syntax with the special wildcard month to ease the job of both machine parsers and a humans.

Offline

#16 2017-09-13 21:25:58

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,150

Re: open_hours: closed the last day of each month ???

SimonPoole wrote:

Jan 01 - 1 day off; Feb 01 -1 day off; Mar 01 -1 day off; Apr 01 -1 day off; May 01 -1 day off; Jun 01 -1 day off; Jul 01 -1 day off; Aug 01 -1 day off; Sep 01 -1 day off; Oct 01 -1 day off; Nov 01 -1 day off; Dec 01 -1 day off

I hope you didn't proposed that nightmare as a solution big_smile

Offline

#18 2017-09-13 23:34:48

SimonPoole
Member
Registered: 2010-03-14
Posts: 1,360

Re: open_hours: closed the last day of each month ???

henke54 wrote:

yep ->
opening hours ... instead of a simple/good visible and 'easy-for-updating-by-shop-owners-themself'
roll tongue

That is actually how we started off with the current specification which ended with something that overall is neither really simple nor easy to build an UI around, all which could have been avoided with a less "simple" approach.

Simon

PS: naturally we could have used an existing spec, for example the very popular iCal, see http://www.ietf.org/rfc/rfc2445.txt for the core specs, it is only 148 pages long, so I'm sure you find it easy to digest.

Offline

#19 2017-09-14 00:06:06

SimonPoole
Member
Registered: 2010-03-14
Posts: 1,360

Re: open_hours: closed the last day of each month ???

vvoovv wrote:
SimonPoole wrote:

Jan 01 - 1 day off; Feb 01 -1 day off; Mar 01 -1 day off; Apr 01 -1 day off; May 01 -1 day off; Jun 01 -1 day off; Jul 01 -1 day off; Aug 01 -1 day off; Sep 01 -1 day off; Oct 01 -1 day off; Nov 01 -1 day off; Dec 01 -1 day off

I hope you didn't proposed that nightmare as a solution big_smile

Well I wasn't saying it was particularly elegant :-), ypids version is a bit better. But the major issue with the above is that it is 227 characters long, leaving only 28 characters for the rest of the spec (plus a bit of white space that could be squeezed out).

Offline

#20 2017-09-14 13:40:42

muralito
Member
Registered: 2012-09-04
Posts: 1,459

Re: open_hours: closed the last day of each month ???

We just have to acknowledge that is not possible for a specification to cover every arbitrary use case. Not all cases described in human language could be written in the specification language.

Suppose someone create "The New OSM OpeningHours Testing Church", which religious services will be only in prime days, counting days as starting in 1 the OSM birthday. Its reasonable for the specification to support this use case?

I think the better solution without modifying the specification is to write as escada suggested.

open; PH open;Jan 31, Mar 31,May 31, Jul 31, Aug 31, Oct 31, Dec 31, Apr 30, Jun 30, Sep 30, Nov 30, Feb 28 off; Feb 29 off

which only differs from the real word in one day every leap year (Feb 28 will be open, but described as closed)
To improve this, you could use the fact that semantically the order of the counts, so adding ";2020 Feb 28, 2024 Feb 28, 2028 Feb 28 open"....

Writing as

open; PH open; Jan 31,Mar 31,May 31,Jul 31,Aug 31,Oct 31,Dec 31,Apr 30,Jun 30,Sep 30,Nov 30,Feb 28 off; Feb 29 off;2020 Feb 28, 2024 Feb 28, 2028 Feb 28, 2032 Feb 28, 2036 Feb 28 open

which is usable right now for the software already in use, at least until 2040...

Offline

#21 2017-09-14 23:00:49

ypid
Member
From: BW, Germany, Earth, Milky Way
Registered: 2013-10-10
Posts: 67
Website

Re: open_hours: closed the last day of each month ???

SimonPoole wrote:

Well I wasn't saying it was particularly elegant :-), ypids version is a bit better. But the major issue with the above is that it is 227 characters long, leaving only 28 characters for the rest of the spec (plus a bit of white space that could be squeezed out).

The 255 char limit can be problematic sometimes with opening hours. But only with the really crazy once. There is even a shorter and by todays spec perfectly valid way to express this:

Jan 31,Mar 01 -1 day,Mar 31,Apr 30,May 31,Jun 30,Jul 31,Aug 31,Sep 30,Oct 31,Nov 30,Dec 31 off

It just combines the way I had expressed it previously and includes the fix from SimonPoole for Feb. Thanks also for your thoughts, muralito. You got me thinking about the "Jan 31" part again. This brings us down to 94 chars and leaves 161 chars for other use which should be a practical option which is specified today. https://openingh.ypid.de/evaluation_tool/ does not support it yet but that is not important here.

Edit: Thanks to SimonPoole for the hint.

Last edited by ypid (2017-09-15 20:05:15)

Offline

#22 2017-09-14 23:17:16

SimonPoole
Member
Registered: 2010-03-14
Posts: 1,360

Re: open_hours: closed the last day of each month ???

ypid wrote:

...,Feb 01 -1 day,Mar 31,.....

That should likely be ...,Mar 01 -1 day,Mar 31,...

Offline

Board footer

Powered by FluxBB