iD
iD copied to clipboard
opening hours form field
http://wiki.openstreetmap.org/wiki/Key:opening_hours
Should we have a cutoff for how many instances of a k/v are present before we specialize for it?
This is basically either 24/7 or a variety of convoluted different types of syntax. Nixing.
After seeing several new users adding their own business to OSM, I think it would be interesting to revisit this at some point by presenting a more complicated form that generated the correct opening_hours=*
syntax. JOSM has a plugin that shows a timeline view (similar to GCal's "week" view) that lets you drag to select the times that you want to be open. GMM has a free-form text box for each day of the week.
JOSM shows a dialog to let you edit an existing tag or add a new one:
Then shows the calendar view:
Dragged areas can cross day boundaries:
... here's an example node that someone added for their own car wash and typed in what made sense to them for P2's opening hours field:
http://www.openstreetmap.org/browse/node/2232512015
opening_hours = Mon-Fri 7:30AM- 6:00 PM Sat 9:00 AM- 3:00 PM
I came up with a mockup of how this might look in iD:
So the idea is that you'd have a textbox at the top that people can enter whatever syntax they want into, and then the week calendar would update based on that. If the syntax doesn't match the rules of opening_hours, the javascript should autocorrect, and explain what was wrong (ie: if you put "Mon", it'll correct to "Mo", and give a message that says "Use two-letter weekday format".)
The problem with this UI design is it won't handle all features of the syntax. Here's some examples that it wont handle: Mo-Fr,Sa[1] 08:00-12:00 (Monday until friday and additionally on first saturday in months from 8 to 12.) Mo-Fr 08:00-12:00, PH off (Monday until friday from 8 to 12, except on public holidays.) Mo-Fr 08:00-16:00, Sa 10:00-14:00, Sa 14:00-18:00 "if weather permits " (The public pool extends its opening hours on saturdays to 18:00, if the sun shines. (external influence))
Also, whoever develops this out should make sure that the syntax rules follow the ones detailed here: http://www.netzwolf.info/en/cartography/osm/time_domain/ That site is linked from the opening_hours wiki page, and provides a very detailed specification of the syntax. It is also where I pulled all the examples above.
I'm working on a parser that will work with the majority of data according to taginfo here. The goal is to cover most usecases but not destroy existing data. Based on this the form in iD would be a simple table with a 'day' column and 'open'/'close' columns.
Hi all, just curious if opening times will be entered in the local timezone of the feature or in UTC? Depending, the editor may need to take the timezone in to account.
OSM uses local time for the opening_hours
tag.
Maybe this library could be used to validate opening_hours and help the user to write a valid one.
To elaborate a little bit more on this. I think the first step would be to make sure that the opening_hours values which make it into the changeset are valid. opening_hours.js is already used by JOSM. Please consider also using it in iD.
Would love to see a pull request for this feature - it's a bit of an undertaking to build a full-fledged calendar interface as a small feature of a map editor.
I don‘t think that someone who knows the iD code base would need more than 30 minutes to implement this. I would probably need longer …
Yell.com has got a very good editor for opening hours.
Just use 7 sliders (one for every day) and add the labels for the times. I think the breaks are the more tricky part.
Week-planner looks good too.
Any progress here? In the mean time maybe a link could be provided to simple instructions (a page like this) for the syntax. Many contributors just fill in something in natural language, which is useless to automated interpreters like OpenLinkMap and OsmAnd.
Also another great alternative not mentioned yet is YoHours.
Maybe iD could give an hint to use one of these solutions when starting writing opening hours manually? It would not be a hard solution to implement right?
It would not be a hard solution to implement right?
Please implement it, if you perceive it to be easy.
Also another great alternative not mentioned yet is YoHours.
Maybe iD could give an hint to use one of these solutions when starting writing opening hours manually?
I just spent about 10 minutes playing around with it and it's unfortunately kind of buggy and hard to use. I do think it's probably a good starting effort though. If it were a bit more polished and could look nice in a lightboxed small dimension iframe, I'd consider it.
It would not be a hard solution to implement right?
I'm vetoing what @tmcw says above, this is too buggy to use currently and I wouldnt merge it. For now spend time improving the tool, but not on integrating it with iD.
Also, supporting all the complex features behind the opening_hours
tag language is nice, but the interface on YoHours is way too complex for iD. Limit to full (or half maybe) hours, don't expose the seasonal options, and only allow one tab to start. If someone wants to build more complex OH strings then they could switch to some advanced mode or something.
@tmcw It was more of a question than an assumption, I would certainly not state on unknown technologies; my apologies if it looked like it.
I just wanted to bump the issue since I found YoHours
a bit earlier and found it valuable to map a swimming pool with seasonal opening hours which would have take me half an hour to do manually.
I am not YoHours
author at all, but considered it as easy enough to use in iD. It seems I was wrong :). At least it may help on what-to-do and what-not-to-do for iD widget.
//cc @PanierAvide: would you like to comment on the issues raised by @bhousel above (https://github.com/openstreetmap/iD/issues/974#issuecomment-133526716)?
Of course, so I'm the author of this buggy interface :) For the while it's not meant to be included in something else, but I was thinking of providing a simple HTML page which could be embed in an iframe. What would be the requirements to include this iframe in iD (dimensions, functionalities, show text input or not, how to expose result value...) ?
I made a first attempt of a minimal embeddable version of YoHours. Things can still be smaller, and the seasons dialog content should be optimized. Let me know if it has any interest.
@PanierAvide I will be happy to see yohours in iD.
Normally we want time table and columns with 24/7 and ("Monday"...) headers, Other settings are less popular and should be displayed as small tabs.
We may want to add more hover explanations to table in user language about how advanced features of opening_hours work. yohours contain no context-sensitive help or hover captions.
Is there any hover caption system specific to iD, or something as simple as <a title="...">
can be used ?
@PanierAvide I think it is ID-specific, You can test it with way tagged as highway=track. CSS class is "form-field-tracktype". Unlike html select it will:
- display shorter/trimmed title
- provide user with translated string when select box is opened
We will need hovers like this, but for calendar controls (sliders) or text fields (hover on opening_hours=24/7 will show "Open 24/7" in user language)
PS. We can annotate most OH strings in natural language, but it will be more demanding task.
Any progress here? I think opening_hours
is one of the most difficult days a Newbie encounter.
So iD should:
- Maybe at least validate the entered value, to prevent bad values
- (Later) offer a nice UI for editing it
Note that also Maps.me has a simple opening_hours
editor, which works great for most cases.
Any progress here? I think opening_hours is one of the most difficult days a Newbie encounter.
Indeed and as a newbie you probably aren't going to look into the wiki and see exactly how it's done. One I saw today from a new user was "Mon-Fri 0800 - 18.30, Sat 0800-1700, Sun 0800-1400" - a shame it was so close but not correct. I wonder if iD could do some basic validation, like checking for two letter days and time separator?
@bhousel here's a couple of examples:
google mapmaker desktop
Clicking on Mon-Sat gives you a dropdown which can be ticked, the hours also give a dropdown with half hourly times.
maps.me android
The advanced mode gives the normal alphanumeric field and some examples of the opening_hours format.
To everyone commenting on this ticket. I don't need inspiration on how to design a date picker. The reason this field has not been built yet is not because I don't know what a date picker is, or know where to find one.
The problem here is that opening_hours
is just a terribly complex grammar and iD needs to support most of it. For example, sunrise-sunset
is currently the 8th most common value for opening_hours
. If somebody edits a business already tagged with opening_hours=sunrise-sunset
, what should this field show? We try very hard not to break existing data.
I do want to support this, but it's not as simple as dropping in a date picker.
What if a day/time picker is only shown when the value of an existing object's opening_hours
tag matched a regex that covers the "simple case"? e.g. Mo-Fr 09:00-17:00; Sa-Su 10:00-13:00
. If it doesn't match such a regex, it shows the standard text box?