Skip to main content
A boolean array of exactly 168 elements representing the hourly open/closed status for one full week (7 days x 24 hours). Used on the opening_168 field when creating or updating locations.

Index mapping

The array starts at Monday 00:00 and ends at Sunday 23:00:
IndexDayHour
0Monday00:00 - 01:00
1Monday01:00 - 02:00
23Monday23:00 - 24:00
24Tuesday00:00 - 01:00
167Sunday23:00 - 24:00

Formula

index = (day_of_week x 24) + hour
Where day_of_week is: Monday = 0, Tuesday = 1, Wednesday = 2, Thursday = 3, Friday = 4, Saturday = 5, Sunday = 6.

Values

ValueMeaning
trueThe location is open during this hour
falseThe location is closed during this hour

Examples

Open Mon-Fri 09:00-18:00, closed weekends

opening_168 = [False] * 168

for day in range(5):  # Monday (0) through Friday (4)
    for hour in range(9, 18):  # 09:00 to 17:59
        opening_168[day * 24 + hour] = True

Open 24/7

opening_168 = [True] * 168

Overnight hours

For locations open past midnight (e.g., a bar open Friday 20:00 to Saturday 03:00), set the late-night hours on the next day:
# Friday 20:00 to Saturday 03:00
for hour in range(20, 24):
    opening_168[4 * 24 + hour] = True   # Friday 20:00-23:59
for hour in range(0, 3):
    opening_168[5 * 24 + hour] = True   # Saturday 00:00-02:59
The array starts on Monday, not Sunday. Many calendar libraries default to Sunday as the first day of the week — make sure to adjust accordingly.