diff options
| author | 2022-04-20 00:12:09 -0400 | |
|---|---|---|
| committer | 2022-04-20 00:12:09 -0400 | |
| commit | 942e313727d1ad886a1024c24fe4a9e8e2e0bb3e (patch) | |
| tree | 1c4d5d826655cdb812c88563a25410f8b54e41d2 /npm_assets/node_modules/luxon/src/info.js | |
| parent | 8eeed31eb2f86ac982fa4b26f93b15828289c56d (diff) | |
New upstream version 8.2.0.upstream/8.2.0
Diffstat (limited to 'npm_assets/node_modules/luxon/src/info.js')
| -rw-r--r-- | npm_assets/node_modules/luxon/src/info.js | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/npm_assets/node_modules/luxon/src/info.js b/npm_assets/node_modules/luxon/src/info.js index 52912ac..5197da2 100644 --- a/npm_assets/node_modules/luxon/src/info.js +++ b/npm_assets/node_modules/luxon/src/info.js @@ -16,7 +16,7 @@ export default class Info { * @return {boolean} */ static hasDST(zone = Settings.defaultZone) { - const proto = DateTime.local() + const proto = DateTime.now() .setZone(zone) .set({ month: 12 }); @@ -57,6 +57,7 @@ export default class Info { * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use * @param {string} [opts.outputCalendar='gregory'] - the calendar * @example Info.months()[0] //=> 'January' * @example Info.months('short')[0] //=> 'Jan' @@ -68,9 +69,9 @@ export default class Info { */ static months( length = "long", - { locale = null, numberingSystem = null, outputCalendar = "gregory" } = {} + { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {} ) { - return Locale.create(locale, numberingSystem, outputCalendar).months(length); + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); } /** @@ -82,14 +83,15 @@ export default class Info { * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use * @param {string} [opts.outputCalendar='gregory'] - the calendar * @return {[string]} */ static monthsFormat( length = "long", - { locale = null, numberingSystem = null, outputCalendar = "gregory" } = {} + { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {} ) { - return Locale.create(locale, numberingSystem, outputCalendar).months(length, true); + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); } /** @@ -99,14 +101,15 @@ export default class Info { * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use * @example Info.weekdays()[0] //=> 'Monday' * @example Info.weekdays('short')[0] //=> 'Mon' * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' * @return {[string]} */ - static weekdays(length = "long", { locale = null, numberingSystem = null } = {}) { - return Locale.create(locale, numberingSystem, null).weekdays(length); + static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); } /** @@ -118,10 +121,14 @@ export default class Info { * @param {Object} opts - options * @param {string} [opts.locale=null] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use * @return {[string]} */ - static weekdaysFormat(length = "long", { locale = null, numberingSystem = null } = {}) { - return Locale.create(locale, numberingSystem, null).weekdays(length, true); + static weekdaysFormat( + length = "long", + { locale = null, numberingSystem = null, locObj = null } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); } /** |
