aboutsummaryrefslogtreecommitdiffstats
path: root/npm_assets/node_modules/luxon/src/info.js
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-04-20 00:13:08 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-04-20 00:13:08 -0400
commitaca2787b50094a4ab1f17162aa92c5263858743e (patch)
treec227d3a22fe454f92162d8d91ecb81f3141ace94 /npm_assets/node_modules/luxon/src/info.js
parent78e717290e125cab92aef712f12ae63fedb4070f (diff)
parent942e313727d1ad886a1024c24fe4a9e8e2e0bb3e (diff)
Update upstream source from tag 'upstream/8.2.0'
Update to upstream version '8.2.0' with Debian dir 65d01d7d78d6b41c0be6eb196ed84354526f9384
Diffstat (limited to 'npm_assets/node_modules/luxon/src/info.js')
-rw-r--r--npm_assets/node_modules/luxon/src/info.js25
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);
}
/**