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

let today = Dates.todayAsIsoString();

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

returns:String

yesterday

let yesterday = Dates.yesterday();

Returns yesterday’s date as a Date object. Source

returns:Date

yesterdayAsIsoString

let yesterday = Dates.yesterdayAsIsoString();

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

returns:string

tomorrow

let tomorrow = Dates.tomorrow();

Returns tomorrow’s date as a Date object. Source

returns:Date

tomorrowAsIsoString

let tomorrow = Dates.tomorrowAsIsoString();

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

returns:String