2.0.3 • Published 4 years ago

dates-formatter-helper v2.0.3

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

Classes

Typedefs

DatesFormatter

Kind: global class

new DatesFormatter()

DatesFormatter Class

datesFormatter.format(date, asUTC) ⇒ string

Formats Date object as string

Kind: instance method of DatesFormatter
Returns: string - String representation of Date

ParamTypeDefaultDescription
dateDateDate object to convert
asUTCbooleantrueWhether to use date input as UTC

datesFormatter.formatRange(dateRange, asUTC) ⇒ Array.<string>

Formats date range as strings

Kind: instance method of DatesFormatter
Returns: Array.<string> - String representation of Dates

ParamTypeDefaultDescription
dateRangeArray.<Date>Date range to convert
asUTCbooleantrueWhether to use date input as UTC

datesFormatter.parse(dateString, asUTC) ⇒ Date

Parses date string to Date

Kind: instance method of DatesFormatter
Returns: Date - The parsed date

ParamTypeDefaultDescription
dateStringstringDate string to parse
asUTCbooleantrueWhether to use date input as UTC

datesFormatter.parseRange(dateStringRange, asUTC) ⇒ Array.<Date> | Array.<object>

Parses date string arrays to Date

Kind: instance method of DatesFormatter
Returns: Array.<Date> | Array.<object> - The parsed dates

ParamTypeDefaultDescription
dateStringRangeArray.<string>Date strings array to parse
asUTCbooleantrueWhether to use date input as UTC

DatesFormatter.DatesFormatter

Kind: static class of DatesFormatter

new DatesFormatter(mode, options)

Creates an instance of DatesFormatter.

ParamTypeDefaultDescription
mode'year' | 'month' | 'week' | 'date'Mode to use for formatting
optionsFormatterOptions{}Config to override default formatter strings

modes

Kind: global enum
Properties

NameDefault
YEARyear
MONTHmonth
WEEKweek
DATEdate

FormatterOptions

Kind: global typedef
Properties

NameType
dateFormatstring
weekFormatstring
monthFormatstring
yearFormatstring
2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago