This is the documentation of version 1.0.0-rc.3. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias OpeningHours

    The operating hours of a POI, which say when it is open for business, including:

    • Regular daily schedules
    • Split shifts, such as lunch break closures
    • Overnight hours
    • 24/7 operation

    Use it to:

    • Display "Open now" / "Closed" status
    • Show upcoming hours
    • Determine if a location is open at a specific time
    • Plan visits during operating hours
    const openingHours: OpeningHours = {
    mode: 'nextSevenDays',
    timeRanges: [
    { start: {...}, end: {...} }, // Monday
    { start: {...}, end: {...} } // Tuesday
    ],
    alwaysOpenThisPeriod: false
    };

    // 24/7 location
    const alwaysOpen: OpeningHours = {
    mode: 'nextSevenDays',
    timeRanges: [{ start: {...}, end: {...} }], // 00:00 to 00:00
    alwaysOpenThisPeriod: true
    };
    type OpeningHours = {
        alwaysOpenThisPeriod: boolean;
        mode: OpeningHoursMode;
        timeRanges: TimeRange[];
    }
    Index
    alwaysOpenThisPeriod: boolean

    Whether the POI is always open during the requested period.

    If true, the location operates 24/7 and timeRanges holds that one range. Otherwise, timeRanges holds the specific open hours.

    The time period the hours cover, currently always 'nextSevenDays'.

    timeRanges: TimeRange[]

    The time ranges when the POI is open, one per opening period.

    Multiple ranges per day mean split shifts, such as closing for lunch. If alwaysOpenThisPeriod is true, it holds one range spanning the period, midnight to midnight.