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

    Type Alias TimeRange

    A period when a POI is open, with start and end moments.

    It can span multiple days, for example opening late one day and closing early the next.

    For same-day hours, start and end are on the same date. For overnight hours, such as open until 2 AM, the end date is after the start date.

    // Monday 9:00 AM to 5:00 PM
    const timeRange: TimeRange = {
    start: { date: new Date('2025-10-20T09:00:00'), hour: 9, minute: 0, ... },
    end: { date: new Date('2025-10-20T17:00:00'), hour: 17, minute: 0, ... }
    };

    // Friday 10 PM to Saturday 2 AM (overnight)
    const overnight: TimeRange = {
    start: { date: new Date('2025-10-24T22:00:00'), hour: 22, ... },
    end: { date: new Date('2025-10-25T02:00:00'), hour: 2, ... }
    };
    type TimeRange = {
        end: Moment;
        start: Moment;
    }
    Index
    end: Moment

    The closing time of this period.

    start: Moment

    The opening time of this period.