Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.96 KB

nifty-tou.temporalrangestariffschedule.md

File metadata and controls

36 lines (24 loc) · 1.96 KB

Home > nifty-tou > TemporalRangesTariffSchedule

TemporalRangesTariffSchedule class

A schedule, or collection, of TemporalRangesTariff rules that supports resolving rates for dates.

Signature:

export default class TemporalRangesTariffSchedule<T extends TemporalRangesTariff, O extends TemporalRangesTariffScheduleOptions> 

Constructors

Constructor Modifiers Description
(constructor)(rules, options) Constructor.

Properties

Property Modifiers Type Description
multipleMatch readonly boolean Get the multiple-match mode.
options readonly O | undefined Get the options.
rules readonly readonly T[] Get the rules.

Methods

Method Modifiers Description
firstMatch(date, utc) Find the first rule that applies on a given date.
matches(date, utc) Find the rules that apply on a given date, repsecting the multipleMatch property.
resolve(date, utc)

Resolve the tariff rates that apply on a given date, respecting the multipleMatch property.

Duplicate rate id values will override existing rates, so that the last-seen rate for a given id is the one returned.