wo-ist-markt.github.io icon indicating copy to clipboard operation
wo-ist-markt.github.io copied to clipboard

replace 'opening_hours' with 'simple-opening-hours'

Open mojoaxel opened this issue 3 years ago • 9 comments

opening_hours is very complex and has dependencies on moment.js, i18next-client and suncalc. At the moment opening_hours accounts for about 37% of the complete bundle size!

It looks like simple-opening-hours also does, what we want but with a much smaller footprint!

mojoaxel avatar Oct 15 '20 15:10 mojoaxel

can you assign this?

Kishore-abhimanyu avatar Oct 19 '20 00:10 Kishore-abhimanyu

@Kishore-abhimanyu If you want to work on this, just do so and provide a pull-request :+1:

mojoaxel avatar Oct 21 '20 14:10 mojoaxel

Raised a pull request. Please review and merge it. See #349.

Kishore-abhimanyu avatar Oct 22 '20 03:10 Kishore-abhimanyu

:heavy_check_mark: moment.js has been replaced with day.js in #343 Is replacing opening_hours.js still a topic?

johnjohndoe avatar Nov 22 '21 12:11 johnjohndoe

Is replacing opening_hours.js still a topic?

Yes. This still would simplify things but also remove some functionality.

mojoaxel avatar Nov 23 '21 14:11 mojoaxel

... but also remove some functionality

Ooh. Like what? Do the libraries not provide the same functionality?

johnjohndoe avatar Nov 23 '21 15:11 johnjohndoe

simple-opening-hours "only supports the human readable parts". e.g.

Mo-Sa 06:00-22:00
Mo-Fr 08:00-18:00; Sa 10:00-14:00
Mo-Fr 08:00-18:00; Sa,Su 10:00-20:00
Mo-Fr 08:00-12:00, We 14:00-18:00
Mo-Fr 08:00-12:00, 14:00-18:00
Mo-Fr 08:00-18:00; We off
24/7

opening_hours supports a much more compley syntax. I think we don't need this over-engineered syntax and should stick to the "human readable" stuff :-)

mojoaxel avatar Nov 23 '21 15:11 mojoaxel

Sounds reasonable at first hand. It would be interesting to find out how many of the current data points cannot be handled by days.js. The result would help to support the decision whether a migration make sense.

Related: Yesterday, I reached out to the Berlin Senat to sort out the "sonstige" data points which cannot be parsed by opening_hours.js. Pending response.

johnjohndoe avatar Nov 23 '21 15:11 johnjohndoe

Related: Yesterday, I reached out to the Berlin Senat to sort out the "sonstige" data points which cannot be parsed by opening_hours.js. Pending response.

Meanwhile, the number of "sonstige" markets has been reduced for Berlin. Still some to be sorted out.

johnjohndoe avatar Mar 07 '22 09:03 johnjohndoe