wo-ist-markt / wo-ist-markt.github.io

A map visualization of periodic markets in different cities.
https://wo-ist-markt.de
Other
84 stars 84 forks source link

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

Open mojoaxel opened 3 years ago

mojoaxel commented 3 years ago

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!

Kishore-abhimanyu commented 3 years ago

can you assign this?

mojoaxel commented 3 years ago

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

Kishore-abhimanyu commented 3 years ago

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

johnjohndoe commented 2 years ago

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

mojoaxel commented 2 years ago

Is replacing opening_hours.js still a topic?

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

johnjohndoe commented 2 years ago

... but also remove some functionality

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

mojoaxel commented 2 years ago

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 :-)

johnjohndoe commented 2 years ago

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 _openinghours.js. Pending response.

johnjohndoe commented 2 years ago

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

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