OpeningHoursParser icon indicating copy to clipboard operation
OpeningHoursParser copied to clipboard

Add evaluation method

Open simonpoole opened this issue 8 years ago • 6 comments

Support evaluation of the OH values.

simonpoole avatar Apr 14 '17 10:04 simonpoole

Still planned?

ramsestom avatar Mar 14 '18 00:03 ramsestom

Sure

simonpoole avatar Mar 14 '18 09:03 simonpoole

Cool. Any deadline?

ramsestom avatar Mar 15 '18 23:03 ramsestom

Hi, I came across this project looking to have a "simple" input opening hours string and a given date/time and evaluate if it is deemed open (true or false). I had a look at the docs and wasn't able to find anything along those lines, what would be the best approach here to do this? Or would running the javascript version serverside be the only option here?

archanox avatar May 16 '22 03:05 archanox

@archanox I had forgotten that this issue was still open :-). There was a 2021 GSOC project to write an evaluator, utilizing this parser: https://github.com/goodudetheboy/OpeningHoursEvaluator

This works quite well as such, however it currently has a dependency on a timezone library that takes ages to load and uses a fair bit of memory making is not really suitable for interactive use, but for bulk processing or a server process that is long lived that isn't relevant. I'm low prio working on an alternative for that dependency but that has stalled a bit.

simonpoole avatar May 16 '22 05:05 simonpoole

Thanks for the tip @simonpoole, I'm currently porting both of these to C# into the one library. So I'll be cleaning up the timezone stuff as I go along.

Edit: It looks like I'm using https://github.com/leonardehrenfried/opening-hours-evaluator instead of the library from goodudetheboy

archanox avatar May 16 '22 17:05 archanox