-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opening hours form field #974
Comments
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 |
... 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
|
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: 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 |
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. Week-planner looks good too. |
Any progress here? |
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? |
Please implement it, if you perceive it to be easy. |
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.
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 |
@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. |
//cc @PanierAvide: would you like to comment on the issues raised by @bhousel above (#974 (comment))? |
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. |
We shouldn't make this too complicated. We should copy the websites/apps that have already figured this out. For example, Google's looks like this: This covers the vast majority of simple cases and as mentioned earlier we could skip trying to parse more complicated cases. |
Exactly, there are many websites/apps you could take inspiration from: Maps.me, StreetComplete, any calendar app, … |
At the very least, data for opening_hours, service_times, and the like needs to be validated by iD, even if there's no full-blown editor that can handle every edge case of the syntax. I've cleaned up a bunch of them over the past couple of days (including the entire states of Rhode Island, Wyoming, North Dakota, South Dakota, the majority of Kansas, and sizeable chunks of Texas) but without something telling the user "Hey, this syntax is wrong, please fix" they will keep slopping down more rubbish making the tag nearly useless. |
Any progress? |
@TheAdventurer64 Any progress would be posted here. |
Someone has alredy coded part of JOSM-like opening hours box: |
There is also a working version in MapComplete.
This might be an interface component, that multiple JS based OSM editors can use; so building this as a separate component sounds like an interesting idea. |
It would be really helpful if there was some movement on this issue. There are lot of people adding opening hours to restaurants around them and it takes time to fix it after them. What about adding support for very simple cases. Like for example the time picker would show only if the It could be as simple as 7 sliders that could be rolled out as a drop down menu. |
There's been a lot of really great screenshots of others doing this. Someone just has to spend the time to make the change to iD 😄 |
Hello, just saying that I'm currently working on a PR to improve iD support of opening hours. |
The earlier concerns about YoHours didn’t come with specific details or acceptance criteria, so I’m also willing to assume that improved access to the tool would be a net positive for most users. #9678 implements something similar to the mockup in #974 (comment) as a stopgap.
Once we have at least a minimal UI like the one in #9678, validation would be a sensible next step, but not before then. It wouldn’t be fair to warn users about broken syntax without offering a solution. opening_hours.js does have validation functionality we could use, though it might be overkill compared to generating a tokenizer just for the purpose of validation. For example, I whipped up a formal definition of the opening_hours syntax for Peggy; though it definitely has some kinks to work out, it would get the job done without needing to analyze the value for actual date ranges. Beyond that, I would reiterate the point in #974 (comment) that all the calendar mockups so far probably fall short of what iD’s inspector needs. A calendar interface is undoubtedly useful for editing, but it takes up far too much space to appear by default in every preset, including when the user merely hovers over a feature to preview its tags. We wouldn’t be able to hide the raw syntax, which is kind of how this all started. There needs to be a more compact representation, similar to the one opening_hours.js’s |
Hello! There's been a lot of discussion on this over the last 10 years. My thoughts are that @Mashin6's suggestions of using sliders may one of the easier approaches for a MVP supporting the simplest/most common subset of opening_hours syntax. I took a first stab at implementing this, although it's very far from being usable and the CSS is still quite ugly, I'd like to get feedback on it before going further in this direction. This comment makes me think the maintainers would prefer a more comprehensive solution, rather than merge in something that only supports of a subset of opening_hours. My personal opinion is that we should provide a good UI for the simpler syntax and just suggest manual editing of tags for the complex syntax. Linking to another tool like #9678 to support the complex syntax also seems like a viable workaround. Would any of the maintainers care to weigh in with their present opinions on this to inform my future work? Thanks in advance! |
Thanks for taking the time to make this mockup. I’m not the official maintainer, but perhaps I could elaborate on my contrarian comments so far. Many of the mockups so far are optimized for the simple kind of opening hours that has a single timespan each day of the week, consistent across all weeks of all years. I agree that this is one of the most important cases to address (with varying levels of importance depending on the POI type and region). It’s fair to start with the most important cases and figure out how to shoehorn edge cases into the UI later. Your proposal would actually make #9678 completely unnecessary, because it covers the same exact cases. However, I think most users who need to use this field are copying opening hours from a sign or website or maybe from memory. These opening hours are always expressed as literal times, so that’s what the user would be able to enter most readily. Any UI that requires dragging, whether on a calendar or a slider, introduces a degree of imprecision. Now you have to watch the time indicator while you drag the slider around. If the shop opens at a quarter past the hour, you’ll need good hand-eye coordination. Where I come from, many schools open or close at five or eight minutes past the hour for some reason. Pairing each double-knobbed slider with two editable text fields would allow the user to adjust the value to match the sign. But at that point, I wonder if the slider is providing any value compared to just the two text fields (perhaps with dropdown menus or increment/decrement buttons). #974 (comment) has an example of what a text field–based design could look like. There’s still the issue of minimizing the field’s vertical space. Maybe the field could start out in its current form, as a single unstructured text field, but when you focus the field, a more structured form could slide out below. This wouldn’t quite prevent the user from ever seeing the raw opening hours syntax, but at least it would get the main editing case out of the way so we can focus on a more comprehensive solution. |
Yeah that makes sense, now that I think about it, the sliders seem a bit fiddly for entering hours, even if limited to 1-hour intervals. With #974 (comment), does "add hours" open a separate block to enter other days? Otherwise, how would the user enter e.g. separate weekend hours with that interface? Or is that not supported in that UI? |
It's been 11 years now. This basic need is still being ignored... Can we solved it ? @tyrasd |
http://wiki.openstreetmap.org/wiki/Key:opening_hours
The text was updated successfully, but these errors were encountered: