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

    Type Alias Moment

    Date and time with convenient derived properties.

    Represents a specific moment in time with pre-calculated components for easy access without additional date parsing.

    const moment: Moment = {
    date: new Date('2025-10-20T09:30:00Z'),
    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

    JavaScript Date object representing this moment.

    dateYYYYMMDD: string

    Date formatted as YYYY-MM-DD string.

    Useful for display or comparison without time components.

    day: number

    Day of month (1-31).

    hour: number

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

    minute: number

    Minute (0-59).

    month: number

    Month number (1-12).

    Note: Unlike JavaScript Date.getMonth(), this is 1-based (January = 1).

    year: number

    Four-digit year (e.g., 2025).