[INACTIVE] A search and discovery app for the "here & now". We're experimenting with ideas on mobile that can better surface content from the open web.
The behavior we want here is to:
1) Show the opening time if the event is later today,
2) Show "tomorrow" if the event is tomorrow, and
3) Show the day of week if the event is any later.
It was kinda hard to wrap my head around our existing OpenHours API, but I think this works. Since our open hours are stored and partitioned by day, and since getOpeningTimes only returns time on the day of the date provided, this iterates through each day until we get a result. Note that the first date we iterate over is today including the time since we don't want to show events from earlier in the day; other dates we iterate over use 0:00 so that getOpeningTimes doesn't skip it.
This also changes getNextOpeningPeriod from > to >= so we include future events that start at midnight.
The behavior we want here is to: 1) Show the opening time if the event is later today, 2) Show "tomorrow" if the event is tomorrow, and 3) Show the day of week if the event is any later.
It was kinda hard to wrap my head around our existing
OpenHours
API, but I think this works. Since our open hours are stored and partitioned by day, and sincegetOpeningTimes
only returns time on the day of the date provided, this iterates through each day until we get a result. Note that the first date we iterate over is today including the time since we don't want to show events from earlier in the day; other dates we iterate over use 0:00 so thatgetOpeningTimes
doesn't skip it.This also changes
getNextOpeningPeriod
from>
to>=
so we include future events that start at midnight.