umbraco-community / Our.Umbraco.OpeningHours

An Umbraco property editor for handling opening hours
MIT License
9 stars 13 forks source link

Something weird with the correct day selection #10

Closed drpeck closed 7 years ago

drpeck commented 8 years ago

I'm getting IsCurrentlyOpen incorrectly returning false so openingHours.IsCurrentlyOpen == false but openingHours.GetDay(System.DateTime.Now).IsOpen == true

The error appears to be that Opens and Closes are completely wrong. Opens and Closes are set to 0:00 on Tuesday at (today is Monday), instead of 9:00 and 23;00 on the Monday.

I'm GMT + 1 in case that is relevant.

abjerner commented 8 years ago

@drpeck The value from openingHours.GetDay(System.DateTime.Now).IsOpen simplify indicates whether the store is open throughout the day, but not at that particular moment. You can use the value from openingHours.GetDay(System.DateTime.Now).IsCurrentlyOpen instead.

Anyways, I have changed the model a bit in the latest code - among other things to support multiple timeslots per day, so the underlying code has also changed a bit. I will definitely do some more testing before the next release, so if there is a bug in the calculations, I will hopefully find it ;)

drpeck commented 8 years ago

Awesome. Makes sense. I look forward to the next release.