Dates

Date and time related utility functions.


today

Returns the actual date as a Date object. Source

Syntax:

today() : Date

Parameters: None

Returns: Date

Example:

import * as Dates from "./utils/Dates.js";

let today = Dates.today();

todayAsIsoString

Returns today's date as string formatted in the ISO format: 2020-11-27. Source

Syntax:

todayAsIsoString() : string

Parameters: None

Returns: String

Example:


yesterday

Returns yesterday's date as a Date object. Source

Syntax:

Parameters: None

Returns: Date

Example:


yesterdayAsIsoString

Returns yesterday's date as a string formatted in ISO format. 2020-11-27. Source

Syntax:

Parameters: None

Returns: String

Example:


tomorrow

Returns tomorrow's date as a Date object. Source

Syntax:

Parameters: None

Returns: Date

Example:


tomorrowAsIsoString

Returns tomorrow's date as a string formatted in ISO format. 2020-11-27. Source

Syntax:

Parameters: None

Returns: String

Example:


Last updated

Was this helpful?