Interface: DateAdapter

    Defined in

    Methods

    add

    add(timestamp, amount, unit): number

    Adds the specified amount of unit to the given timestamp.

    Parameters

    Returns

    number

    Defined in


    diff

    diff(a, b, unit): number

    Returns the number of unit between the given timestamps.

    Parameters

    NameTypeDescription
    anumberthe input timestamp (reference)
    bnumberthe timestamp to subtract
    TimeUnitthe unit as string

    Returns

    number

    Defined in


    endOf(timestamp, unit): number

    Parameters

    Returns

    number

    Defined in


    format

    format(timestamp, format): string

    Returns the formatted date in the specified format for a given timestamp.

    Parameters

    NameTypeDescription
    timestampnumberthe timestamp to format
    formatTimeUnitthe date/time token

    Returns

    string

    Defined in


    formats

    formats(): Object

    Returns a map of time formats for the supported formatting units defined in Unit as well as ‘datetime’ representing a detailed date/time string.

    Returns

    Object

    Defined in


    Parameters

    Returns

    void

    Defined in


    parse

    parse(value, format?): number

    Parses the given value and return the associated timestamp.

    Parameters

    NameTypeDescription
    valueunknownthe value to parse (usually comes from the data)
    format?TimeUnit-

    Returns

    number

    Defined in


    startOf

    startOf(timestamp, unit, weekday?): number

    Returns start of unit for the given timestamp.

    Parameters

    Returns

    Defined in

    adapters.d.ts:51 (opens new window)