Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 2.17 KB

nifty-tou.yeartemporalrangestariff.parseyears.md

File metadata and controls

39 lines (25 loc) · 2.17 KB

Home > nifty-tou > YearTemporalRangesTariff > parseYears

YearTemporalRangesTariff.parseYears() method

Parse time range criteria into a YearTemporalRangesTariff instance.

Signature:

static parseYears(locale: string, yearRange?: string, monthRange?: string, dayOfMonthRange?: string, dayOfWeekRange?: string, minuteOfDayRange?: string, rates?: TariffRate[], options?: TemporalRangesTariffFormatOptions): YearTemporalRangesTariff;

Parameters

Parameter Type Description
locale string the locale to parse the ranges as
yearRange string (Optional) the year range to parse, for example 2000-2023
monthRange string (Optional) the month range to parse, for example January-December, Jan-Dec, or 1-12
dayOfMonthRange string (Optional) the day of month range to parse, for example 1-31
dayOfWeekRange string (Optional) the day of week range to parse, for example Monday-Sunday, Mon-Sun, or 1-7
minuteOfDayRange string (Optional) the minute of day range to parse, for example 00:00-24:00 or 0-24
rates TariffRate[] (Optional) the tariff rates to associate with the time range criteria
options TemporalRangesTariffFormatOptions (Optional) the formatting options

Returns:

YearTemporalRangesTariff

the new instance

Remarks

Note that the minuteOfDayRange can be specified as a range of HH:MM 24-hour hour and minute values, or whole hours. For example 01:00-08:00 and 1-8 are equivalent.

Additionally, all range values may be specified as * to mean "all possible values", in which that range will be resolved to undefined.