Skip to content
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

Replace/refactor the opening_hours library #7974

Open
RedAuburn opened this issue Apr 23, 2024 · 7 comments
Open

Replace/refactor the opening_hours library #7974

RedAuburn opened this issue Apr 23, 2024 · 7 comments
Labels
Core Cross-platform C++ libraries with a core functionality Epic A large body work Opening Hours Business Hours, off time, holidays, seasonal Refactoring

Comments

@RedAuburn
Copy link
Sponsor Member

RedAuburn commented Apr 23, 2024

The current opening_hours implementation can't handle many cases present in OM data. This issue has been opened to centralise discussion on replacement or refactoring of the opening_hours library.

The current implementation is (afaik) a Maps.Me conversion of opening_hours.js to C++.

A replacement library would need to:

  1. Be written in C++ for multi-platform support?
  2. (please comment/edit with more)

related issues:

@RedAuburn RedAuburn added Epic A large body work Core Cross-platform C++ libraries with a core functionality Refactoring Opening Hours Business Hours, off time, holidays, seasonal labels Apr 23, 2024
@RedAuburn
Copy link
Sponsor Member Author

RedAuburn commented Apr 23, 2024

maybe we could generate & store the opening_hours timetable at map generation, instead of at runtime?
for editing, we can just convert to OSM format when submitting the edit

@biodranik
Copy link
Member

maybe we could generate & store the opening_hours timetable at map generation, instead of at runtime?

Which timetable do you have in mind? Are you proposing to convert raw strings to something else? What about "advanced" editor?

@biodranik
Copy link
Member

The current implementation is (afaik) a Maps.Me conversion of opening_hours.js to C++.

Not exactly. Btw, I can't build the referenced js library. Are there any js => C++ converters?

@map-per
Copy link
Member

map-per commented Apr 26, 2024

maybe we could generate & store the opening_hours timetable at map generation, instead of at runtime?

I think that approach would cause problems for complicated opening_hours values like e.g. Mo-Fr 09:00-18:00; 2023 Jun 10-2023 Aug 15 Mo-Fr 09:00-20:00; 2023 Jun 10-2023 Aug 15 Sa 08:00-12:00; PH off (example from the wiki page)

@RedAuburn
Copy link
Sponsor Member Author

I think that approach would cause problems for complicated opening_hours values like e.g. Mo-Fr 09:00-18:00; 2023 Jun 10-2023 Aug 15 Mo-Fr 09:00-20:00; 2023 Jun 10-2023 Aug 15 Sa 08:00-12:00; PH off (example from the wiki page)

mm, you might be right.. I guess it's worth checking how performant it is to get the current opening_hours status to see if any refactoring is even worth it

@RedAuburn
Copy link
Sponsor Member Author

RedAuburn commented Apr 26, 2024

Not exactly. Btw, I can't build the referenced js library.

strange, the CI in their git is passing.

Are there any js => C++ converters?

i'm honestly not sure, but it looks like maybe it's not possible :/ https://surma.dev/things/compile-js/

@matheusgomesms
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Cross-platform C++ libraries with a core functionality Epic A large body work Opening Hours Business Hours, off time, holidays, seasonal Refactoring
Projects
None yet
Development

No branches or pull requests

4 participants