This is the documentation of version 0.62.1. Go to the latest version, 1.0.0.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias TimeRange

    Time range with start and end moments.

    Represents a period when a POI is open. Can span multiple days (e.g., opening late one day and closing early the next).

    • For same-day hours: start and end are on the same date
    • For overnight hours: end date is after start date (e.g., open until 2 AM)
    // 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

    Closing time for this period.

    start: Moment

    Opening time for this period.