open_hours
open_hours copied to clipboard
Find next open slot when given a timestamp
It would be useful to get the next open slot for a given time.
When will the store be open next?
(You can currently get this information from the between function if you craft your arguments accordingly).
Hi @kwando 👋
Thanks for your suggestion. I'm thinking about adding this function to the TimeSlot module.
def from(%Schedule{} = schedule, %DateTime{} = instant, limit // 1) do
end
This function will return as many %TimeSlot{} as you provide in the limit parameter. WDYT?
I've pushed #2 to implement your suggestion. Feedback is welcome