Classes
Typedefs
DatesFormatter
Kind: global class
- DatesFormatter
- new DatesFormatter()
- instance
- .format(date, [asUTC]) ⇒
string
- .formatRange(dateRange, [asUTC]) ⇒
Array.<string>
- .parse(dateString, [asUTC]) ⇒
Date
- .parseRange(dateStringRange, [asUTC]) ⇒
Array.<Date>
|Array.<object>
- .format(date, [asUTC]) ⇒
- static
new DatesFormatter()
DatesFormatter Class
string
datesFormatter.format(date, [asUTC]) ⇒ Formats Date object as string
Kind: instance method of DatesFormatter
Returns: string
- String representation of Date
Param | Type | Default | Description |
---|---|---|---|
date | Date |
Date object to convert | |
[asUTC] | boolean |
true |
Whether to use date input as UTC |
Array.<string>
datesFormatter.formatRange(dateRange, [asUTC]) ⇒ Formats date range as strings
Kind: instance method of DatesFormatter
Returns: Array.<string>
- String representation of Dates
Param | Type | Default | Description |
---|---|---|---|
dateRange | Array.<Date> |
Date range to convert | |
[asUTC] | boolean |
true |
Whether to use date input as UTC |
Date
datesFormatter.parse(dateString, [asUTC]) ⇒ Parses date string to Date
Kind: instance method of DatesFormatter
Returns: Date
- The parsed date
Param | Type | Default | Description |
---|---|---|---|
dateString | string |
Date string to parse | |
[asUTC] | boolean |
true |
Whether to use date input as UTC |
Array.<Date>
| Array.<object>
datesFormatter.parseRange(dateStringRange, [asUTC]) ⇒ Parses date string arrays to Date
Kind: instance method of DatesFormatter
Returns: Array.<Date>
| Array.<object>
- The parsed dates
Param | Type | Default | Description |
---|---|---|---|
dateStringRange | Array.<string> |
Date strings array to parse | |
[asUTC] | boolean |
true |
Whether to use date input as UTC |
DatesFormatter.DatesFormatter
Kind: static class of DatesFormatter
new DatesFormatter(mode, [options])
Creates an instance of DatesFormatter.
Param | Type | Default | Description |
---|---|---|---|
mode | 'year' | 'month' | 'week' | 'date' |
Mode to use for formatting | |
[options] | FormatterOptions |
{} |
Config to override default formatter strings |
modes
Kind: global enum
Properties
Name | Default |
---|---|
YEAR | year |
MONTH | month |
WEEK | week |
DATE | date |
FormatterOptions
Kind: global typedef
Properties
Name | Type |
---|---|
[dateFormat] | string |
[weekFormat] | string |
[monthFormat] | string |
[yearFormat] | string |