Static erasReturn an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.
Info.eras() //=> [ 'BC', 'AD' ]
Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]
Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]
Optional length: StringUnitLength = "short"the length of the era representation, such as "short" or "long".
options
Static featuresReturn the set of available features in this environment. Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. Keys:
relative: whether this environment supports relative time formattingInfo.features() //=> { relative: false }
Static hasDSTStatic isStatic meridiemsReturn an array of meridiems.
Info.meridiems() //=> [ 'AM', 'PM' ]
Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]
options
Static monthsReturn an array of standalone month names.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
Info.months()[0] //=> 'January'
Info.months('short')[0] //=> 'Jan'
Info.months('numeric')[0] //=> '1'
Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'
Info.months('numeric', { locale: 'ar' })[0] //=> '١'
Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'
Optional length: UnitLength = "long"the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long"
options
Static monthsReturn an array of format month names. Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that changes the string. See months
Optional length: UnitLength = "long"the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long"
options
Static normalizeConverts the input into a Zone instance.
input is already a Zone instance, it is returned unchanged.input is a string containing a valid IANA time zone name, a Zone instance
with that name is returned.input is the string "system", the system's time zone is returned.input is the string "default", the default time zone, as defined in
Settings.defaultZone is returned.input is a string that doesn't refer to a known time zone, a Zone
instance with isValid == false is returned.input is null or undefined, the default zone is returned.Optional input: ZoneLikethe value to be converted
Static weekdaysReturn an array of standalone week names.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
Info.weekdays()[0] //=> 'Monday'
Info.weekdays('short')[0] //=> 'Mon'
Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'
Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'
Optional length: WeekUnitLengths = "long"the length of the weekday representation, such as "narrow", "short", "long".
options
Static weekdaysReturn an array of format week names. Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that changes the string. See Info#weekdays
Optional length: StringUnitLength = "long"the length of the weekday representation, such as "narrow", "short", "long".
options
Generated using TypeDoc
The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.