ts-time/utils

Consumption

import * as utils from "ts-time/utils";

isLeapYear#

(year: number): boolean

year
Absolute year.
returns

True if this is a leap year.

(year % 4 === 0) && (year % 100 !== 0 || year % 400 === 0)

isTimeZoneSupport#

(): boolean

returns

True if current browser/environment supports local time zones such as "Europe/Berlin". See Browser support at the home page.

requireTimeZoneSupport#

(): boolean

returns

Same as isTimeZoneSupport, but also logs a warning message to the browser/environment console if local time zones are not supported. The function guarantees that the message is only logged once, on the first function call. This function is called internally on the first attempt to instantiate a local ZoneId.