GoMap icon indicating copy to clipboard operation
GoMap copied to clipboard

Add a Opening Hours editor

Open TheAdventurer64 opened this issue 4 years ago • 10 comments

If you press the > button next to hours, a opening hours screen should pop up. I propose that it should look something like MAPS.ME’s Opening Hours editor, not like YoHours.

TheAdventurer64 avatar Jul 02 '20 09:07 TheAdventurer64

In order to be able to do that, we need a parser for the opening_hours tag.

Maybe we could utilize existing code, e. g. opening-hours/opening_hours.js.

@bryceco, is this something one could go ahead with, or do you have a different idea?

wtimme avatar Sep 03 '20 09:09 wtimme

Editor from maps.me

Here is a screenshot of the maps.me editor for opening hours, in case someone does not have the app installed:

IMG_0579

Editor from StreetComplete

Here's a screenshot from the editor in StreetComplete:

StreetComplete opening hour editor

wtimme avatar Sep 03 '20 15:09 wtimme

@wtimme it seems like a 3rd party parser is the way to go, even though I’m not excited about embedding JS in the app. If you’d like to work on this that would be great. It’s definitely a nice feature to have, but looks like a lot of effort required.

bryceco avatar Sep 04 '20 00:09 bryceco

I did some research, and it looks as if opening_hours.js is meant to be used to check whether a place is open at any given date/date range. What we would probably need, however, is a way of converting the tag value (e. g. "Mo-Fr 10:00-12:00") into a set of rules, for which we would then build the UI.

wtimme avatar Sep 07 '20 16:09 wtimme

Progress?

TheAdventurer64 avatar Oct 15 '21 17:10 TheAdventurer64

Sorry in advance for being a newbie, and thanks for this great work y’all have been doing!!

I just installed on iOS. What’s the status on this? I’m confused because while my edit via GoMap remains in place there, it didn’t get added to my OSM Edit History (nor anywhere else).

I went ahead and edited it via a different interface ( not GoMap — I think I used OrganicMaps), and it then showed up on my OSM profile.

The below screenshot is of GoMap.

5C8C3636-F9C8-473D-867A-FDFD39F5A415

EDIT: Wait, now there’s an Upload button which I don’t think was there before.

F9B5FB63-EA72-4126-88D2-372470BD73A2

Could this be due to previously limited EditPermissions (given I’m a new editor on OSM), and someone just granted me more access ?

Goodness. Maybe adding a “Tutorial” link to the README etc for brand-new wet-behind-the-ears folks would help what to expect etc <3

jwmh avatar Jun 22 '23 07:06 jwmh

@jwmh The upload button appears only when you have made edits. People will typically make multiple related edits before performing a single upload.

bryceco avatar Jun 22 '23 15:06 bryceco

Could this be due to previously limited EditPermissions (given I’m a new editor on OSM)

As a sidenote, not related to this issue: There are no limited permissions for new editors in OSM. Everyone can edit everything from the get-go.

habi avatar Jun 28 '23 06:06 habi

Alternatively, add a parser for the hours format so you can warn users when they add a bad one.

If I type in a value for opening hours that is not in the correct format https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification the parser would color the text red. It would be even better if it had good error messages like "unknown day name "Ma". Did you mean "Mo"?" or whatever

verhovsky avatar Apr 28 '24 22:04 verhovsky

I started work on a parser and editor at https://github.com/bryceco/OpeningHours/ It isn't complete enough as an editor (I used SwiftUI and ran into too many issues I couldn't fix), but it would work fine for verifying syntax.

bryceco avatar Apr 28 '24 23:04 bryceco