Kvaesitso icon indicating copy to clipboard operation
Kvaesitso copied to clipboard

Chore: migrate OSM parsing of opening-hours to external library

Open shtrophic opened this issue 1 year ago • 2 comments

I have come accross some cases where our current parsing of the OSM opening_hours tag is not correct. While digging into the issue, I discovered that in the meantime of merging the OSM PR, some new libraries for just that have popped up. One of them is https://github.com/westnordost/osm-opening-hours which is also used in https://github.com/streetcomplete/StreetComplete.

I suggest migrating to that library instead of re-inventing the wheel, since also, our implementation does not cover month- or season-specific opening hours. What do you think?

Also, would you prefer this change to be a seperate PR or can I just include it in #772?

shtrophic avatar May 24 '24 16:05 shtrophic

Feel free. Does that require any changes to the OpeningSchedule interface? Or is it just an implementation detail?

Also, would you prefer this change to be a seperate PR or can I just include it in https://github.com/MM2-0/Kvaesitso/pull/772?

I'd prefer it in a separate PR, so that it doesn't block #772 from being merged.

MM2-0 avatar May 24 '24 20:05 MM2-0

Does that require any changes to the OpeningSchedule interface?

Probably not; Creating some OpeningSchedule instance from results returned by that library should still be possible. We can also just skip tracking any season- or month specifics since we only show weekly previews; That is, I'd create the OpeningSchedule instance based on the library result and the users LocalTime.

shtrophic avatar May 25 '24 08:05 shtrophic