Class: Duration
Converts duration strings into ms and future dates
Constructors
new Duration()
new Duration(
pattern:string):Duration
Create a new Duration instance
Parameters
| Parameter | Type | Description |
|---|---|---|
pattern | string | The string to parse |
Returns
Source
Properties
days
days:
number=0
The amount of days extracted from the text.
Source
hours
hours:
number=0
The amount of hours extracted from the text.
Source
microseconds
microseconds:
number=0
The amount of microseconds extracted from the text.
Source
milliseconds
milliseconds:
number=0
The amount of milliseconds extracted from the text.
Source
minutes
minutes:
number=0
The amount of minutes extracted from the text.
Source
months
months:
number=0
The amount of months extracted from the text.
Source
nanoseconds
nanoseconds:
number=0
The amount of nanoseconds extracted from the text.
Source
offset
offset:
number
The offset
Source
seconds
seconds:
number=0
The amount of seconds extracted from the text.
Source
weeks
weeks:
number=0
The amount of weeks extracted from the text.
Source
years
years:
number=0
The amount of years extracted from the text.
Source
aAndAnRegex
privatestaticreadonlyaAndAnRegex:RegExp
The RegExp used for replacing a/an with 1
Source
commaRegex
privatestaticreadonlycommaRegex:RegExp
The RegExp used for removing commas
Source
patternRegex
privatestaticreadonlypatternRegex:RegExp
The RegExp used for the pattern parsing
Source
Accessors
fromNow
getfromNow():Date
Get the date from now
Returns
Source
Methods
dateFrom()
Get the date from
Parameters
| Parameter | Type | Description |
|---|---|---|
date | Date | The Date instance to get the date from |