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 Moment

    A moment in time, with its date components pre-calculated so you don't need to parse the date.

    const moment: Moment = {
    date: new Date(2025, 9, 20, 9, 30),
    dateYYYYMMDD: '2025-10-20',
    year: 2025,
    month: 10,
    day: 20,
    hour: 9,
    minute: 30
    };
    type Moment = {
        date: Date;
        dateYYYYMMDD: string;
        day: number;
        hour: number;
        minute: number;
        month: number;
        year: number;
    }
    Index
    date: Date

    The JavaScript Date of this moment.

    It holds the POI's local wall-clock time read in the runtime's time zone, not the instant. To tell whether a POI is open now, compare against the current time in the POI's timeZone.

    dateYYYYMMDD: string

    The date as a YYYY-MM-DD string, for display or comparison without time components.

    day: number

    The day of the month (1-31).

    hour: number

    The hour in 24-hour format (0-23).

    minute: number

    The minute (0-59).

    month: number

    The month number (1-12).

    Note that unlike JavaScript Date.getMonth(), it is 1-based (January = 1).

    year: number

    The four-digit year, such as 2025.