node_modules: update
This commit is contained in:
parent
4a21c51f2f
commit
b91baffed3
107 changed files with 3886 additions and 2943 deletions
11
node_modules/luxon/CHANGELOG.md
generated
vendored
11
node_modules/luxon/CHANGELOG.md
generated
vendored
|
@ -1,5 +1,16 @@
|
|||
# Changelog
|
||||
|
||||
## 1.25.0
|
||||
|
||||
* fix fromFormat with Intl formats containing non-breaking spaces
|
||||
* Support higher precisision in ISO milliseconds
|
||||
* Some fixes for 00:30 timezones
|
||||
* Fix some throwOnInvalid for invalid Intervals
|
||||
* Various doc fixes
|
||||
* Fix Interval#isSame for empty intervals
|
||||
* Mark package as side effect-free
|
||||
* Add support for intervals with a large number of seconds
|
||||
|
||||
## 1.24.1 (2020-05-04)
|
||||
|
||||
* Remove erroneous `console.log` call
|
||||
|
|
106
node_modules/luxon/build/amd/luxon.js
generated
vendored
106
node_modules/luxon/build/amd/luxon.js
generated
vendored
|
@ -126,7 +126,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
|
@ -281,6 +281,12 @@ define(['exports'], function (exports) { 'use strict';
|
|||
month: s,
|
||||
day: n
|
||||
};
|
||||
var DATE_MED_WITH_WEEKDAY = {
|
||||
year: n,
|
||||
month: s,
|
||||
day: n,
|
||||
weekday: s
|
||||
};
|
||||
var DATE_FULL = {
|
||||
year: n,
|
||||
month: l,
|
||||
|
@ -663,20 +669,19 @@ define(['exports'], function (exports) { 'use strict';
|
|||
return normalized;
|
||||
}
|
||||
function formatOffset(offset, format) {
|
||||
var hours = Math.trunc(offset / 60),
|
||||
minutes = Math.abs(offset % 60),
|
||||
sign = hours >= 0 && !Object.is(hours, -0) ? "+" : "-",
|
||||
base = "" + sign + Math.abs(hours);
|
||||
var hours = Math.trunc(Math.abs(offset / 60)),
|
||||
minutes = Math.trunc(Math.abs(offset % 60)),
|
||||
sign = offset >= 0 ? "+" : "-";
|
||||
|
||||
switch (format) {
|
||||
case "short":
|
||||
return "" + sign + padStart(Math.abs(hours), 2) + ":" + padStart(minutes, 2);
|
||||
return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2);
|
||||
|
||||
case "narrow":
|
||||
return minutes > 0 ? base + ":" + minutes : base;
|
||||
return "" + sign + hours + (minutes > 0 ? ":" + minutes : "");
|
||||
|
||||
case "techie":
|
||||
return "" + sign + padStart(Math.abs(hours), 2) + padStart(minutes, 2);
|
||||
return "" + sign + padStart(hours, 2) + padStart(minutes, 2);
|
||||
|
||||
default:
|
||||
throw new RangeError("Value format " + format + " is out of range for property format");
|
||||
|
@ -829,6 +834,9 @@ define(['exports'], function (exports) { 'use strict';
|
|||
case stringify(DATE_MED):
|
||||
return "LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_MED_WITH_WEEKDAY):
|
||||
return "EEE, LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_FULL):
|
||||
return "LLLL d, yyyy";
|
||||
|
||||
|
@ -2936,7 +2944,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
|
||||
|
||||
var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
|
||||
isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + offsetRegex.source + "?"),
|
||||
isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"),
|
||||
isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
|
||||
|
@ -2986,7 +2994,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
} // ISO duration parsing
|
||||
|
||||
|
||||
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
|
||||
function extractISODuration(match) {
|
||||
var s = match[0],
|
||||
|
@ -3174,6 +3182,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
},
|
||||
casualMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: 52,
|
||||
days: 365,
|
||||
|
@ -3188,6 +3197,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
days: 91,
|
||||
hours: 91 * 24,
|
||||
minutes: 91 * 24 * 60,
|
||||
seconds: 91 * 24 * 60 * 60,
|
||||
milliseconds: 91 * 24 * 60 * 60 * 1000
|
||||
},
|
||||
months: {
|
||||
|
@ -3203,6 +3213,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
daysInMonthAccurate = 146097.0 / 4800,
|
||||
accurateMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: daysInYearAccurate / 7,
|
||||
days: daysInYearAccurate,
|
||||
|
@ -3756,7 +3767,6 @@ define(['exports'], function (exports) { 'use strict';
|
|||
accumulated = {},
|
||||
vals = this.toObject();
|
||||
var lastUnit;
|
||||
normalizeValues(this.matrix, vals);
|
||||
|
||||
for (var _iterator2 = _createForOfIteratorHelperLoose(orderedUnits), _step2; !(_step2 = _iterator2()).done;) {
|
||||
var k = _step2.value;
|
||||
|
@ -4025,7 +4035,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
* * **Accessors** Use {@link start} and {@link end} to get the start and end.
|
||||
* * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.
|
||||
* * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}.
|
||||
* * **Output** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toISODate}, {@link toISOTime}, {@link toFormat}, and {@link toDuration}.
|
||||
*/
|
||||
|
||||
|
@ -4146,20 +4156,35 @@ define(['exports'], function (exports) { 'use strict';
|
|||
e = _split[1];
|
||||
|
||||
if (s && e) {
|
||||
var start = DateTime.fromISO(s, opts),
|
||||
end = DateTime.fromISO(e, opts);
|
||||
var start, startIsValid;
|
||||
|
||||
if (start.isValid && end.isValid) {
|
||||
try {
|
||||
start = DateTime.fromISO(s, opts);
|
||||
startIsValid = start.isValid;
|
||||
} catch (e) {
|
||||
startIsValid = false;
|
||||
}
|
||||
|
||||
var end, endIsValid;
|
||||
|
||||
try {
|
||||
end = DateTime.fromISO(e, opts);
|
||||
endIsValid = end.isValid;
|
||||
} catch (e) {
|
||||
endIsValid = false;
|
||||
}
|
||||
|
||||
if (startIsValid && endIsValid) {
|
||||
return Interval.fromDateTimes(start, end);
|
||||
}
|
||||
|
||||
if (start.isValid) {
|
||||
if (startIsValid) {
|
||||
var dur = Duration.fromISO(e, opts);
|
||||
|
||||
if (dur.isValid) {
|
||||
return Interval.after(start, dur);
|
||||
}
|
||||
} else if (end.isValid) {
|
||||
} else if (endIsValid) {
|
||||
var _dur = Duration.fromISO(s, opts);
|
||||
|
||||
if (_dur.isValid) {
|
||||
|
@ -4227,7 +4252,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
;
|
||||
|
||||
_proto.hasSame = function hasSame(unit) {
|
||||
return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
}
|
||||
/**
|
||||
* Return whether this Interval has the same start and end DateTimes.
|
||||
|
@ -4815,7 +4840,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
/**
|
||||
* Return an array of standalone week names.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -4845,7 +4870,7 @@ define(['exports'], function (exports) { 'use strict';
|
|||
* 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 {@link weekdays}
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale=null] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -5139,13 +5164,20 @@ define(['exports'], function (exports) { 'use strict';
|
|||
};
|
||||
}
|
||||
|
||||
var NBSP = String.fromCharCode(160);
|
||||
var spaceOrNBSP = "( |" + NBSP + ")";
|
||||
var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
|
||||
|
||||
function fixListRegex(s) {
|
||||
// make dots optional and also make them literal
|
||||
return s.replace(/\./, "\\.?");
|
||||
// make space and non breakable space characters interchangeable
|
||||
return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
|
||||
}
|
||||
|
||||
function stripInsensitivities(s) {
|
||||
return s.replace(/\./, "").toLowerCase();
|
||||
return s.replace(/\./g, "") // ignore dots that were made optional
|
||||
.replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
function oneOf(strings, startIndex) {
|
||||
|
@ -5910,24 +5942,20 @@ define(['exports'], function (exports) { 'use strict';
|
|||
|
||||
|
||||
function adjustTime(inst, dur) {
|
||||
var _dur;
|
||||
|
||||
var keys = Object.keys(dur.values);
|
||||
|
||||
if (keys.indexOf("milliseconds") === -1) {
|
||||
keys.push("milliseconds");
|
||||
}
|
||||
|
||||
dur = (_dur = dur).shiftTo.apply(_dur, keys);
|
||||
var oPre = inst.o,
|
||||
year = inst.c.year + dur.years,
|
||||
month = inst.c.month + dur.months + dur.quarters * 3,
|
||||
year = inst.c.year + Math.trunc(dur.years),
|
||||
month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,
|
||||
c = Object.assign({}, inst.c, {
|
||||
year: year,
|
||||
month: month,
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
|
||||
}),
|
||||
millisToAdd = Duration.fromObject({
|
||||
years: dur.years - Math.trunc(dur.years),
|
||||
quarters: dur.quarters - Math.trunc(dur.quarters),
|
||||
months: dur.months - Math.trunc(dur.months),
|
||||
weeks: dur.weeks - Math.trunc(dur.weeks),
|
||||
days: dur.days - Math.trunc(dur.days),
|
||||
hours: dur.hours,
|
||||
minutes: dur.minutes,
|
||||
seconds: dur.seconds,
|
||||
|
@ -8034,6 +8062,16 @@ define(['exports'], function (exports) { 'use strict';
|
|||
get: function get() {
|
||||
return DATE_MED;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'Fri, Oct 14, 1983'
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "DATE_MED_WITH_WEEKDAY",
|
||||
get: function get() {
|
||||
return DATE_MED_WITH_WEEKDAY;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'October 14, 1983'
|
||||
* @type {Object}
|
||||
|
|
2
node_modules/luxon/build/amd/luxon.js.map
generated
vendored
2
node_modules/luxon/build/amd/luxon.js.map
generated
vendored
File diff suppressed because one or more lines are too long
106
node_modules/luxon/build/cjs-browser/luxon.js
generated
vendored
106
node_modules/luxon/build/cjs-browser/luxon.js
generated
vendored
|
@ -128,7 +128,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
|||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
|
@ -283,6 +283,12 @@ var DATE_MED = {
|
|||
month: s,
|
||||
day: n
|
||||
};
|
||||
var DATE_MED_WITH_WEEKDAY = {
|
||||
year: n,
|
||||
month: s,
|
||||
day: n,
|
||||
weekday: s
|
||||
};
|
||||
var DATE_FULL = {
|
||||
year: n,
|
||||
month: l,
|
||||
|
@ -665,20 +671,19 @@ function normalizeObject(obj, normalizer, nonUnitKeys) {
|
|||
return normalized;
|
||||
}
|
||||
function formatOffset(offset, format) {
|
||||
var hours = Math.trunc(offset / 60),
|
||||
minutes = Math.abs(offset % 60),
|
||||
sign = hours >= 0 && !Object.is(hours, -0) ? "+" : "-",
|
||||
base = "" + sign + Math.abs(hours);
|
||||
var hours = Math.trunc(Math.abs(offset / 60)),
|
||||
minutes = Math.trunc(Math.abs(offset % 60)),
|
||||
sign = offset >= 0 ? "+" : "-";
|
||||
|
||||
switch (format) {
|
||||
case "short":
|
||||
return "" + sign + padStart(Math.abs(hours), 2) + ":" + padStart(minutes, 2);
|
||||
return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2);
|
||||
|
||||
case "narrow":
|
||||
return minutes > 0 ? base + ":" + minutes : base;
|
||||
return "" + sign + hours + (minutes > 0 ? ":" + minutes : "");
|
||||
|
||||
case "techie":
|
||||
return "" + sign + padStart(Math.abs(hours), 2) + padStart(minutes, 2);
|
||||
return "" + sign + padStart(hours, 2) + padStart(minutes, 2);
|
||||
|
||||
default:
|
||||
throw new RangeError("Value format " + format + " is out of range for property format");
|
||||
|
@ -831,6 +836,9 @@ function formatString(knownFormat) {
|
|||
case stringify(DATE_MED):
|
||||
return "LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_MED_WITH_WEEKDAY):
|
||||
return "EEE, LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_FULL):
|
||||
return "LLLL d, yyyy";
|
||||
|
||||
|
@ -2938,7 +2946,7 @@ function simpleParse() {
|
|||
|
||||
|
||||
var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
|
||||
isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + offsetRegex.source + "?"),
|
||||
isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"),
|
||||
isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
|
||||
|
@ -2988,7 +2996,7 @@ function extractIANAZone(match, cursor) {
|
|||
} // ISO duration parsing
|
||||
|
||||
|
||||
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
|
||||
function extractISODuration(match) {
|
||||
var s = match[0],
|
||||
|
@ -3176,6 +3184,7 @@ var lowOrderMatrix = {
|
|||
},
|
||||
casualMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: 52,
|
||||
days: 365,
|
||||
|
@ -3190,6 +3199,7 @@ var lowOrderMatrix = {
|
|||
days: 91,
|
||||
hours: 91 * 24,
|
||||
minutes: 91 * 24 * 60,
|
||||
seconds: 91 * 24 * 60 * 60,
|
||||
milliseconds: 91 * 24 * 60 * 60 * 1000
|
||||
},
|
||||
months: {
|
||||
|
@ -3205,6 +3215,7 @@ var lowOrderMatrix = {
|
|||
daysInMonthAccurate = 146097.0 / 4800,
|
||||
accurateMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: daysInYearAccurate / 7,
|
||||
days: daysInYearAccurate,
|
||||
|
@ -3758,7 +3769,6 @@ var Duration = /*#__PURE__*/function () {
|
|||
accumulated = {},
|
||||
vals = this.toObject();
|
||||
var lastUnit;
|
||||
normalizeValues(this.matrix, vals);
|
||||
|
||||
for (var _iterator2 = _createForOfIteratorHelperLoose(orderedUnits), _step2; !(_step2 = _iterator2()).done;) {
|
||||
var k = _step2.value;
|
||||
|
@ -4027,7 +4037,7 @@ function validateStartEnd(start, end) {
|
|||
* * **Accessors** Use {@link start} and {@link end} to get the start and end.
|
||||
* * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.
|
||||
* * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}.
|
||||
* * **Output** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toISODate}, {@link toISOTime}, {@link toFormat}, and {@link toDuration}.
|
||||
*/
|
||||
|
||||
|
@ -4148,20 +4158,35 @@ var Interval = /*#__PURE__*/function () {
|
|||
e = _split[1];
|
||||
|
||||
if (s && e) {
|
||||
var start = DateTime.fromISO(s, opts),
|
||||
end = DateTime.fromISO(e, opts);
|
||||
var start, startIsValid;
|
||||
|
||||
if (start.isValid && end.isValid) {
|
||||
try {
|
||||
start = DateTime.fromISO(s, opts);
|
||||
startIsValid = start.isValid;
|
||||
} catch (e) {
|
||||
startIsValid = false;
|
||||
}
|
||||
|
||||
var end, endIsValid;
|
||||
|
||||
try {
|
||||
end = DateTime.fromISO(e, opts);
|
||||
endIsValid = end.isValid;
|
||||
} catch (e) {
|
||||
endIsValid = false;
|
||||
}
|
||||
|
||||
if (startIsValid && endIsValid) {
|
||||
return Interval.fromDateTimes(start, end);
|
||||
}
|
||||
|
||||
if (start.isValid) {
|
||||
if (startIsValid) {
|
||||
var dur = Duration.fromISO(e, opts);
|
||||
|
||||
if (dur.isValid) {
|
||||
return Interval.after(start, dur);
|
||||
}
|
||||
} else if (end.isValid) {
|
||||
} else if (endIsValid) {
|
||||
var _dur = Duration.fromISO(s, opts);
|
||||
|
||||
if (_dur.isValid) {
|
||||
|
@ -4229,7 +4254,7 @@ var Interval = /*#__PURE__*/function () {
|
|||
;
|
||||
|
||||
_proto.hasSame = function hasSame(unit) {
|
||||
return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
}
|
||||
/**
|
||||
* Return whether this Interval has the same start and end DateTimes.
|
||||
|
@ -4817,7 +4842,7 @@ var Info = /*#__PURE__*/function () {
|
|||
/**
|
||||
* Return an array of standalone week names.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -4847,7 +4872,7 @@ var Info = /*#__PURE__*/function () {
|
|||
* 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 {@link weekdays}
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale=null] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -5141,13 +5166,20 @@ function intUnit(regex, post) {
|
|||
};
|
||||
}
|
||||
|
||||
var NBSP = String.fromCharCode(160);
|
||||
var spaceOrNBSP = "( |" + NBSP + ")";
|
||||
var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
|
||||
|
||||
function fixListRegex(s) {
|
||||
// make dots optional and also make them literal
|
||||
return s.replace(/\./, "\\.?");
|
||||
// make space and non breakable space characters interchangeable
|
||||
return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
|
||||
}
|
||||
|
||||
function stripInsensitivities(s) {
|
||||
return s.replace(/\./, "").toLowerCase();
|
||||
return s.replace(/\./g, "") // ignore dots that were made optional
|
||||
.replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
function oneOf(strings, startIndex) {
|
||||
|
@ -5912,24 +5944,20 @@ function objToTS(obj, offset, zone) {
|
|||
|
||||
|
||||
function adjustTime(inst, dur) {
|
||||
var _dur;
|
||||
|
||||
var keys = Object.keys(dur.values);
|
||||
|
||||
if (keys.indexOf("milliseconds") === -1) {
|
||||
keys.push("milliseconds");
|
||||
}
|
||||
|
||||
dur = (_dur = dur).shiftTo.apply(_dur, keys);
|
||||
var oPre = inst.o,
|
||||
year = inst.c.year + dur.years,
|
||||
month = inst.c.month + dur.months + dur.quarters * 3,
|
||||
year = inst.c.year + Math.trunc(dur.years),
|
||||
month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,
|
||||
c = Object.assign({}, inst.c, {
|
||||
year: year,
|
||||
month: month,
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
|
||||
}),
|
||||
millisToAdd = Duration.fromObject({
|
||||
years: dur.years - Math.trunc(dur.years),
|
||||
quarters: dur.quarters - Math.trunc(dur.quarters),
|
||||
months: dur.months - Math.trunc(dur.months),
|
||||
weeks: dur.weeks - Math.trunc(dur.weeks),
|
||||
days: dur.days - Math.trunc(dur.days),
|
||||
hours: dur.hours,
|
||||
minutes: dur.minutes,
|
||||
seconds: dur.seconds,
|
||||
|
@ -8036,6 +8064,16 @@ var DateTime = /*#__PURE__*/function () {
|
|||
get: function get() {
|
||||
return DATE_MED;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'Fri, Oct 14, 1983'
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "DATE_MED_WITH_WEEKDAY",
|
||||
get: function get() {
|
||||
return DATE_MED_WITH_WEEKDAY;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'October 14, 1983'
|
||||
* @type {Object}
|
||||
|
|
2
node_modules/luxon/build/cjs-browser/luxon.js.map
generated
vendored
2
node_modules/luxon/build/cjs-browser/luxon.js.map
generated
vendored
File diff suppressed because one or more lines are too long
106
node_modules/luxon/build/global/luxon.js
generated
vendored
106
node_modules/luxon/build/global/luxon.js
generated
vendored
|
@ -127,7 +127,7 @@ var luxon = (function (exports) {
|
|||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
|
@ -282,6 +282,12 @@ var luxon = (function (exports) {
|
|||
month: s,
|
||||
day: n
|
||||
};
|
||||
var DATE_MED_WITH_WEEKDAY = {
|
||||
year: n,
|
||||
month: s,
|
||||
day: n,
|
||||
weekday: s
|
||||
};
|
||||
var DATE_FULL = {
|
||||
year: n,
|
||||
month: l,
|
||||
|
@ -664,20 +670,19 @@ var luxon = (function (exports) {
|
|||
return normalized;
|
||||
}
|
||||
function formatOffset(offset, format) {
|
||||
var hours = Math.trunc(offset / 60),
|
||||
minutes = Math.abs(offset % 60),
|
||||
sign = hours >= 0 && !Object.is(hours, -0) ? "+" : "-",
|
||||
base = "" + sign + Math.abs(hours);
|
||||
var hours = Math.trunc(Math.abs(offset / 60)),
|
||||
minutes = Math.trunc(Math.abs(offset % 60)),
|
||||
sign = offset >= 0 ? "+" : "-";
|
||||
|
||||
switch (format) {
|
||||
case "short":
|
||||
return "" + sign + padStart(Math.abs(hours), 2) + ":" + padStart(minutes, 2);
|
||||
return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2);
|
||||
|
||||
case "narrow":
|
||||
return minutes > 0 ? base + ":" + minutes : base;
|
||||
return "" + sign + hours + (minutes > 0 ? ":" + minutes : "");
|
||||
|
||||
case "techie":
|
||||
return "" + sign + padStart(Math.abs(hours), 2) + padStart(minutes, 2);
|
||||
return "" + sign + padStart(hours, 2) + padStart(minutes, 2);
|
||||
|
||||
default:
|
||||
throw new RangeError("Value format " + format + " is out of range for property format");
|
||||
|
@ -830,6 +835,9 @@ var luxon = (function (exports) {
|
|||
case stringify(DATE_MED):
|
||||
return "LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_MED_WITH_WEEKDAY):
|
||||
return "EEE, LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_FULL):
|
||||
return "LLLL d, yyyy";
|
||||
|
||||
|
@ -2937,7 +2945,7 @@ var luxon = (function (exports) {
|
|||
|
||||
|
||||
var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
|
||||
isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + offsetRegex.source + "?"),
|
||||
isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"),
|
||||
isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
|
||||
|
@ -2987,7 +2995,7 @@ var luxon = (function (exports) {
|
|||
} // ISO duration parsing
|
||||
|
||||
|
||||
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
|
||||
function extractISODuration(match) {
|
||||
var s = match[0],
|
||||
|
@ -3175,6 +3183,7 @@ var luxon = (function (exports) {
|
|||
},
|
||||
casualMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: 52,
|
||||
days: 365,
|
||||
|
@ -3189,6 +3198,7 @@ var luxon = (function (exports) {
|
|||
days: 91,
|
||||
hours: 91 * 24,
|
||||
minutes: 91 * 24 * 60,
|
||||
seconds: 91 * 24 * 60 * 60,
|
||||
milliseconds: 91 * 24 * 60 * 60 * 1000
|
||||
},
|
||||
months: {
|
||||
|
@ -3204,6 +3214,7 @@ var luxon = (function (exports) {
|
|||
daysInMonthAccurate = 146097.0 / 4800,
|
||||
accurateMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: daysInYearAccurate / 7,
|
||||
days: daysInYearAccurate,
|
||||
|
@ -3757,7 +3768,6 @@ var luxon = (function (exports) {
|
|||
accumulated = {},
|
||||
vals = this.toObject();
|
||||
var lastUnit;
|
||||
normalizeValues(this.matrix, vals);
|
||||
|
||||
for (var _iterator2 = _createForOfIteratorHelperLoose(orderedUnits), _step2; !(_step2 = _iterator2()).done;) {
|
||||
var k = _step2.value;
|
||||
|
@ -4026,7 +4036,7 @@ var luxon = (function (exports) {
|
|||
* * **Accessors** Use {@link start} and {@link end} to get the start and end.
|
||||
* * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.
|
||||
* * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}.
|
||||
* * **Output** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toISODate}, {@link toISOTime}, {@link toFormat}, and {@link toDuration}.
|
||||
*/
|
||||
|
||||
|
@ -4147,20 +4157,35 @@ var luxon = (function (exports) {
|
|||
e = _split[1];
|
||||
|
||||
if (s && e) {
|
||||
var start = DateTime.fromISO(s, opts),
|
||||
end = DateTime.fromISO(e, opts);
|
||||
var start, startIsValid;
|
||||
|
||||
if (start.isValid && end.isValid) {
|
||||
try {
|
||||
start = DateTime.fromISO(s, opts);
|
||||
startIsValid = start.isValid;
|
||||
} catch (e) {
|
||||
startIsValid = false;
|
||||
}
|
||||
|
||||
var end, endIsValid;
|
||||
|
||||
try {
|
||||
end = DateTime.fromISO(e, opts);
|
||||
endIsValid = end.isValid;
|
||||
} catch (e) {
|
||||
endIsValid = false;
|
||||
}
|
||||
|
||||
if (startIsValid && endIsValid) {
|
||||
return Interval.fromDateTimes(start, end);
|
||||
}
|
||||
|
||||
if (start.isValid) {
|
||||
if (startIsValid) {
|
||||
var dur = Duration.fromISO(e, opts);
|
||||
|
||||
if (dur.isValid) {
|
||||
return Interval.after(start, dur);
|
||||
}
|
||||
} else if (end.isValid) {
|
||||
} else if (endIsValid) {
|
||||
var _dur = Duration.fromISO(s, opts);
|
||||
|
||||
if (_dur.isValid) {
|
||||
|
@ -4228,7 +4253,7 @@ var luxon = (function (exports) {
|
|||
;
|
||||
|
||||
_proto.hasSame = function hasSame(unit) {
|
||||
return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
}
|
||||
/**
|
||||
* Return whether this Interval has the same start and end DateTimes.
|
||||
|
@ -4816,7 +4841,7 @@ var luxon = (function (exports) {
|
|||
/**
|
||||
* Return an array of standalone week names.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -4846,7 +4871,7 @@ var luxon = (function (exports) {
|
|||
* 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 {@link weekdays}
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale=null] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -5140,13 +5165,20 @@ var luxon = (function (exports) {
|
|||
};
|
||||
}
|
||||
|
||||
var NBSP = String.fromCharCode(160);
|
||||
var spaceOrNBSP = "( |" + NBSP + ")";
|
||||
var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
|
||||
|
||||
function fixListRegex(s) {
|
||||
// make dots optional and also make them literal
|
||||
return s.replace(/\./, "\\.?");
|
||||
// make space and non breakable space characters interchangeable
|
||||
return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
|
||||
}
|
||||
|
||||
function stripInsensitivities(s) {
|
||||
return s.replace(/\./, "").toLowerCase();
|
||||
return s.replace(/\./g, "") // ignore dots that were made optional
|
||||
.replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
function oneOf(strings, startIndex) {
|
||||
|
@ -5911,24 +5943,20 @@ var luxon = (function (exports) {
|
|||
|
||||
|
||||
function adjustTime(inst, dur) {
|
||||
var _dur;
|
||||
|
||||
var keys = Object.keys(dur.values);
|
||||
|
||||
if (keys.indexOf("milliseconds") === -1) {
|
||||
keys.push("milliseconds");
|
||||
}
|
||||
|
||||
dur = (_dur = dur).shiftTo.apply(_dur, keys);
|
||||
var oPre = inst.o,
|
||||
year = inst.c.year + dur.years,
|
||||
month = inst.c.month + dur.months + dur.quarters * 3,
|
||||
year = inst.c.year + Math.trunc(dur.years),
|
||||
month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,
|
||||
c = Object.assign({}, inst.c, {
|
||||
year: year,
|
||||
month: month,
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
|
||||
}),
|
||||
millisToAdd = Duration.fromObject({
|
||||
years: dur.years - Math.trunc(dur.years),
|
||||
quarters: dur.quarters - Math.trunc(dur.quarters),
|
||||
months: dur.months - Math.trunc(dur.months),
|
||||
weeks: dur.weeks - Math.trunc(dur.weeks),
|
||||
days: dur.days - Math.trunc(dur.days),
|
||||
hours: dur.hours,
|
||||
minutes: dur.minutes,
|
||||
seconds: dur.seconds,
|
||||
|
@ -8035,6 +8063,16 @@ var luxon = (function (exports) {
|
|||
get: function get() {
|
||||
return DATE_MED;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'Fri, Oct 14, 1983'
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "DATE_MED_WITH_WEEKDAY",
|
||||
get: function get() {
|
||||
return DATE_MED_WITH_WEEKDAY;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'October 14, 1983'
|
||||
* @type {Object}
|
||||
|
|
2
node_modules/luxon/build/global/luxon.js.map
generated
vendored
2
node_modules/luxon/build/global/luxon.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
node_modules/luxon/build/global/luxon.min.js
generated
vendored
2
node_modules/luxon/build/global/luxon.min.js
generated
vendored
File diff suppressed because one or more lines are too long
2
node_modules/luxon/build/global/luxon.min.js.map
generated
vendored
2
node_modules/luxon/build/global/luxon.min.js.map
generated
vendored
File diff suppressed because one or more lines are too long
101
node_modules/luxon/build/node/luxon.js
generated
vendored
101
node_modules/luxon/build/node/luxon.js
generated
vendored
|
@ -86,6 +86,12 @@ const DATE_MED = {
|
|||
month: s,
|
||||
day: n
|
||||
};
|
||||
const DATE_MED_WITH_WEEKDAY = {
|
||||
year: n,
|
||||
month: s,
|
||||
day: n,
|
||||
weekday: s
|
||||
};
|
||||
const DATE_FULL = {
|
||||
year: n,
|
||||
month: l,
|
||||
|
@ -454,20 +460,19 @@ function normalizeObject(obj, normalizer, nonUnitKeys) {
|
|||
return normalized;
|
||||
}
|
||||
function formatOffset(offset, format) {
|
||||
const hours = Math.trunc(offset / 60),
|
||||
minutes = Math.abs(offset % 60),
|
||||
sign = hours >= 0 && !Object.is(hours, -0) ? "+" : "-",
|
||||
base = `${sign}${Math.abs(hours)}`;
|
||||
const hours = Math.trunc(Math.abs(offset / 60)),
|
||||
minutes = Math.trunc(Math.abs(offset % 60)),
|
||||
sign = offset >= 0 ? "+" : "-";
|
||||
|
||||
switch (format) {
|
||||
case "short":
|
||||
return `${sign}${padStart(Math.abs(hours), 2)}:${padStart(minutes, 2)}`;
|
||||
return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
|
||||
|
||||
case "narrow":
|
||||
return minutes > 0 ? `${base}:${minutes}` : base;
|
||||
return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
|
||||
|
||||
case "techie":
|
||||
return `${sign}${padStart(Math.abs(hours), 2)}${padStart(minutes, 2)}`;
|
||||
return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
|
||||
|
||||
default:
|
||||
throw new RangeError(`Value format ${format} is out of range for property format`);
|
||||
|
@ -612,6 +617,9 @@ function formatString(knownFormat) {
|
|||
case stringify(DATE_MED):
|
||||
return "LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_MED_WITH_WEEKDAY):
|
||||
return "EEE, LLL d, yyyy";
|
||||
|
||||
case stringify(DATE_FULL):
|
||||
return "LLLL d, yyyy";
|
||||
|
||||
|
@ -2467,7 +2475,7 @@ function simpleParse(...keys) {
|
|||
|
||||
|
||||
const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
|
||||
isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${offsetRegex.source}?`),
|
||||
isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`),
|
||||
isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
|
||||
|
@ -2517,7 +2525,7 @@ function extractIANAZone(match, cursor) {
|
|||
} // ISO duration parsing
|
||||
|
||||
|
||||
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
|
||||
function extractISODuration(match) {
|
||||
const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match;
|
||||
|
@ -2673,6 +2681,7 @@ const lowOrderMatrix = {
|
|||
},
|
||||
casualMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: 52,
|
||||
days: 365,
|
||||
|
@ -2687,6 +2696,7 @@ const lowOrderMatrix = {
|
|||
days: 91,
|
||||
hours: 91 * 24,
|
||||
minutes: 91 * 24 * 60,
|
||||
seconds: 91 * 24 * 60 * 60,
|
||||
milliseconds: 91 * 24 * 60 * 60 * 1000
|
||||
},
|
||||
months: {
|
||||
|
@ -2702,6 +2712,7 @@ const lowOrderMatrix = {
|
|||
daysInMonthAccurate = 146097.0 / 4800,
|
||||
accurateMatrix = Object.assign({
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: daysInYearAccurate / 7,
|
||||
days: daysInYearAccurate,
|
||||
|
@ -3241,7 +3252,6 @@ class Duration {
|
|||
accumulated = {},
|
||||
vals = this.toObject();
|
||||
let lastUnit;
|
||||
normalizeValues(this.matrix, vals);
|
||||
|
||||
for (const k of orderedUnits) {
|
||||
if (units.indexOf(k) >= 0) {
|
||||
|
@ -3479,7 +3489,7 @@ function validateStartEnd(start, end) {
|
|||
* * **Accessors** Use {@link start} and {@link end} to get the start and end.
|
||||
* * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.
|
||||
* * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}.
|
||||
* * **Output** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toISODate}, {@link toISOTime}, {@link toFormat}, and {@link toDuration}.
|
||||
*/
|
||||
|
||||
|
@ -3594,20 +3604,35 @@ class Interval {
|
|||
const [s, e] = (text || "").split("/", 2);
|
||||
|
||||
if (s && e) {
|
||||
const start = DateTime.fromISO(s, opts),
|
||||
end = DateTime.fromISO(e, opts);
|
||||
let start, startIsValid;
|
||||
|
||||
if (start.isValid && end.isValid) {
|
||||
try {
|
||||
start = DateTime.fromISO(s, opts);
|
||||
startIsValid = start.isValid;
|
||||
} catch (e) {
|
||||
startIsValid = false;
|
||||
}
|
||||
|
||||
let end, endIsValid;
|
||||
|
||||
try {
|
||||
end = DateTime.fromISO(e, opts);
|
||||
endIsValid = end.isValid;
|
||||
} catch (e) {
|
||||
endIsValid = false;
|
||||
}
|
||||
|
||||
if (startIsValid && endIsValid) {
|
||||
return Interval.fromDateTimes(start, end);
|
||||
}
|
||||
|
||||
if (start.isValid) {
|
||||
if (startIsValid) {
|
||||
const dur = Duration.fromISO(e, opts);
|
||||
|
||||
if (dur.isValid) {
|
||||
return Interval.after(start, dur);
|
||||
}
|
||||
} else if (end.isValid) {
|
||||
} else if (endIsValid) {
|
||||
const dur = Duration.fromISO(s, opts);
|
||||
|
||||
if (dur.isValid) {
|
||||
|
@ -3706,7 +3731,7 @@ class Interval {
|
|||
|
||||
|
||||
hasSame(unit) {
|
||||
return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
}
|
||||
/**
|
||||
* Return whether this Interval has the same start and end DateTimes.
|
||||
|
@ -4191,7 +4216,7 @@ class Info {
|
|||
/**
|
||||
* Return an array of standalone week names.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -4214,7 +4239,7 @@ class Info {
|
|||
* 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 {@link weekdays}
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale=null] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -4458,13 +4483,20 @@ function intUnit(regex, post = i => i) {
|
|||
};
|
||||
}
|
||||
|
||||
const NBSP = String.fromCharCode(160);
|
||||
const spaceOrNBSP = `( |${NBSP})`;
|
||||
const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
|
||||
|
||||
function fixListRegex(s) {
|
||||
// make dots optional and also make them literal
|
||||
return s.replace(/\./, "\\.?");
|
||||
// make space and non breakable space characters interchangeable
|
||||
return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
|
||||
}
|
||||
|
||||
function stripInsensitivities(s) {
|
||||
return s.replace(/\./, "").toLowerCase();
|
||||
return s.replace(/\./g, "") // ignore dots that were made optional
|
||||
.replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
function oneOf(strings, startIndex) {
|
||||
|
@ -5202,22 +5234,20 @@ function objToTS(obj, offset, zone) {
|
|||
|
||||
|
||||
function adjustTime(inst, dur) {
|
||||
const keys = Object.keys(dur.values);
|
||||
|
||||
if (keys.indexOf("milliseconds") === -1) {
|
||||
keys.push("milliseconds");
|
||||
}
|
||||
|
||||
dur = dur.shiftTo(...keys);
|
||||
const oPre = inst.o,
|
||||
year = inst.c.year + dur.years,
|
||||
month = inst.c.month + dur.months + dur.quarters * 3,
|
||||
year = inst.c.year + Math.trunc(dur.years),
|
||||
month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,
|
||||
c = Object.assign({}, inst.c, {
|
||||
year,
|
||||
month,
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
|
||||
}),
|
||||
millisToAdd = Duration.fromObject({
|
||||
years: dur.years - Math.trunc(dur.years),
|
||||
quarters: dur.quarters - Math.trunc(dur.quarters),
|
||||
months: dur.months - Math.trunc(dur.months),
|
||||
weeks: dur.weeks - Math.trunc(dur.weeks),
|
||||
days: dur.days - Math.trunc(dur.days),
|
||||
hours: dur.hours,
|
||||
minutes: dur.minutes,
|
||||
seconds: dur.seconds,
|
||||
|
@ -7107,6 +7137,15 @@ class DateTime {
|
|||
static get DATE_MED() {
|
||||
return DATE_MED;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'Fri, Oct 14, 1983'
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
|
||||
static get DATE_MED_WITH_WEEKDAY() {
|
||||
return DATE_MED_WITH_WEEKDAY;
|
||||
}
|
||||
/**
|
||||
* {@link toLocaleString} format like 'October 14, 1983'
|
||||
* @type {Object}
|
||||
|
|
2
node_modules/luxon/build/node/luxon.js.map
generated
vendored
2
node_modules/luxon/build/node/luxon.js.map
generated
vendored
File diff suppressed because one or more lines are too long
21
node_modules/luxon/package.json
generated
vendored
21
node_modules/luxon/package.json
generated
vendored
|
@ -1,26 +1,26 @@
|
|||
{
|
||||
"_from": "luxon@1.24.1",
|
||||
"_id": "luxon@1.24.1",
|
||||
"_from": "luxon@1.25.0",
|
||||
"_id": "luxon@1.25.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-CgnIMKAWT0ghcuWFfCWBnWGOddM0zu6c4wZAWmD0NN7MZTnro0+833DF6tJep+xlxRPg4KtsYEHYLfTMBQKwYg==",
|
||||
"_integrity": "sha512-hEgLurSH8kQRjY6i4YLey+mcKVAWXbDNlZRmM6AgWDJ1cY3atl8Ztf5wEY7VBReFbmGnwQPz7KYJblL8B2k0jQ==",
|
||||
"_location": "/luxon",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "luxon@1.24.1",
|
||||
"raw": "luxon@1.25.0",
|
||||
"name": "luxon",
|
||||
"escapedName": "luxon",
|
||||
"rawSpec": "1.24.1",
|
||||
"rawSpec": "1.25.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.24.1"
|
||||
"fetchSpec": "1.25.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/docker-hub-utils"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/luxon/-/luxon-1.24.1.tgz",
|
||||
"_shasum": "a8383266131ed4eaed4b5f430f96f3695403a52a",
|
||||
"_spec": "luxon@1.24.1",
|
||||
"_resolved": "https://registry.npmjs.org/luxon/-/luxon-1.25.0.tgz",
|
||||
"_shasum": "d86219e90bc0102c0eb299d65b2f5e95efe1fe72",
|
||||
"_spec": "luxon@1.25.0",
|
||||
"_where": "/home/dawidd6/github/dawidd6/action-debian-package/node_modules/docker-hub-utils",
|
||||
"author": {
|
||||
"name": "Isaac Cambron"
|
||||
|
@ -124,6 +124,7 @@
|
|||
"site": "cp -r site/** build/",
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"unpkg": "build/global/luxon.min.js",
|
||||
"version": "1.24.1"
|
||||
"version": "1.25.0"
|
||||
}
|
||||
|
|
29
node_modules/luxon/src/datetime.js
generated
vendored
29
node_modules/luxon/src/datetime.js
generated
vendored
|
@ -122,22 +122,23 @@ function objToTS(obj, offset, zone) {
|
|||
|
||||
// create a new DT instance by adding a duration, adjusting for DSTs
|
||||
function adjustTime(inst, dur) {
|
||||
const keys = Object.keys(dur.values);
|
||||
if (keys.indexOf("milliseconds") === -1) {
|
||||
keys.push("milliseconds");
|
||||
}
|
||||
|
||||
dur = dur.shiftTo(...keys);
|
||||
|
||||
const oPre = inst.o,
|
||||
year = inst.c.year + dur.years,
|
||||
month = inst.c.month + dur.months + dur.quarters * 3,
|
||||
year = inst.c.year + Math.trunc(dur.years),
|
||||
month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,
|
||||
c = Object.assign({}, inst.c, {
|
||||
year,
|
||||
month,
|
||||
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
|
||||
day:
|
||||
Math.min(inst.c.day, daysInMonth(year, month)) +
|
||||
Math.trunc(dur.days) +
|
||||
Math.trunc(dur.weeks) * 7
|
||||
}),
|
||||
millisToAdd = Duration.fromObject({
|
||||
years: dur.years - Math.trunc(dur.years),
|
||||
quarters: dur.quarters - Math.trunc(dur.quarters),
|
||||
months: dur.months - Math.trunc(dur.months),
|
||||
weeks: dur.weeks - Math.trunc(dur.weeks),
|
||||
days: dur.days - Math.trunc(dur.days),
|
||||
hours: dur.hours,
|
||||
minutes: dur.minutes,
|
||||
seconds: dur.seconds,
|
||||
|
@ -1943,6 +1944,14 @@ export default class DateTime {
|
|||
return Formats.DATE_MED;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link toLocaleString} format like 'Fri, Oct 14, 1983'
|
||||
* @type {Object}
|
||||
*/
|
||||
static get DATE_MED_WITH_WEEKDAY() {
|
||||
return Formats.DATE_MED_WITH_WEEKDAY;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link toLocaleString} format like 'October 14, 1983'
|
||||
* @type {Object}
|
||||
|
|
5
node_modules/luxon/src/duration.js
generated
vendored
5
node_modules/luxon/src/duration.js
generated
vendored
|
@ -37,6 +37,7 @@ const lowOrderMatrix = {
|
|||
casualMatrix = Object.assign(
|
||||
{
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: 52,
|
||||
days: 365,
|
||||
|
@ -51,6 +52,7 @@ const lowOrderMatrix = {
|
|||
days: 91,
|
||||
hours: 91 * 24,
|
||||
minutes: 91 * 24 * 60,
|
||||
seconds: 91 * 24 * 60 * 60,
|
||||
milliseconds: 91 * 24 * 60 * 60 * 1000
|
||||
},
|
||||
months: {
|
||||
|
@ -69,6 +71,7 @@ const lowOrderMatrix = {
|
|||
accurateMatrix = Object.assign(
|
||||
{
|
||||
years: {
|
||||
quarters: 4,
|
||||
months: 12,
|
||||
weeks: daysInYearAccurate / 7,
|
||||
days: daysInYearAccurate,
|
||||
|
@ -588,8 +591,6 @@ export default class Duration {
|
|||
vals = this.toObject();
|
||||
let lastUnit;
|
||||
|
||||
normalizeValues(this.matrix, vals);
|
||||
|
||||
for (const k of orderedUnits) {
|
||||
if (units.indexOf(k) >= 0) {
|
||||
lastUnit = k;
|
||||
|
|
2
node_modules/luxon/src/impl/english.js
generated
vendored
2
node_modules/luxon/src/impl/english.js
generated
vendored
|
@ -187,6 +187,8 @@ export function formatString(knownFormat) {
|
|||
return "M/d/yyyy";
|
||||
case stringify(Formats.DATE_MED):
|
||||
return "LLL d, yyyy";
|
||||
case stringify(Formats.DATE_MED_WITH_WEEKDAY):
|
||||
return "EEE, LLL d, yyyy";
|
||||
case stringify(Formats.DATE_FULL):
|
||||
return "LLLL d, yyyy";
|
||||
case stringify(Formats.DATE_HUGE):
|
||||
|
|
7
node_modules/luxon/src/impl/formats.js
generated
vendored
7
node_modules/luxon/src/impl/formats.js
generated
vendored
|
@ -18,6 +18,13 @@ export const DATE_MED = {
|
|||
day: n
|
||||
};
|
||||
|
||||
export const DATE_MED_WITH_WEEKDAY = {
|
||||
year: n,
|
||||
month: s,
|
||||
day: n,
|
||||
weekday: s
|
||||
};
|
||||
|
||||
export const DATE_FULL = {
|
||||
year: n,
|
||||
month: l,
|
||||
|
|
4
node_modules/luxon/src/impl/regexParser.js
generated
vendored
4
node_modules/luxon/src/impl/regexParser.js
generated
vendored
|
@ -66,7 +66,7 @@ function simpleParse(...keys) {
|
|||
|
||||
// ISO and SQL parsing
|
||||
const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,
|
||||
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
|
||||
isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${offsetRegex.source}?`),
|
||||
isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`),
|
||||
isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
|
||||
|
@ -120,7 +120,7 @@ function extractIANAZone(match, cursor) {
|
|||
|
||||
// ISO duration parsing
|
||||
|
||||
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
||||
|
||||
function extractISODuration(match) {
|
||||
const [
|
||||
|
|
12
node_modules/luxon/src/impl/tokenParser.js
generated
vendored
12
node_modules/luxon/src/impl/tokenParser.js
generated
vendored
|
@ -12,13 +12,21 @@ function intUnit(regex, post = i => i) {
|
|||
return { regex, deser: ([s]) => post(parseDigits(s)) };
|
||||
}
|
||||
|
||||
const NBSP = String.fromCharCode(160);
|
||||
const spaceOrNBSP = `( |${NBSP})`;
|
||||
const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
|
||||
|
||||
function fixListRegex(s) {
|
||||
// make dots optional and also make them literal
|
||||
return s.replace(/\./, "\\.?");
|
||||
// make space and non breakable space characters interchangeable
|
||||
return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
|
||||
}
|
||||
|
||||
function stripInsensitivities(s) {
|
||||
return s.replace(/\./, "").toLowerCase();
|
||||
return s
|
||||
.replace(/\./g, "") // ignore dots that were made optional
|
||||
.replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
function oneOf(strings, startIndex) {
|
||||
|
|
13
node_modules/luxon/src/impl/util.js
generated
vendored
13
node_modules/luxon/src/impl/util.js
generated
vendored
|
@ -263,18 +263,17 @@ export function normalizeObject(obj, normalizer, nonUnitKeys) {
|
|||
}
|
||||
|
||||
export function formatOffset(offset, format) {
|
||||
const hours = Math.trunc(offset / 60),
|
||||
minutes = Math.abs(offset % 60),
|
||||
sign = hours >= 0 && !Object.is(hours, -0) ? "+" : "-",
|
||||
base = `${sign}${Math.abs(hours)}`;
|
||||
const hours = Math.trunc(Math.abs(offset / 60)),
|
||||
minutes = Math.trunc(Math.abs(offset % 60)),
|
||||
sign = offset >= 0 ? "+" : "-";
|
||||
|
||||
switch (format) {
|
||||
case "short":
|
||||
return `${sign}${padStart(Math.abs(hours), 2)}:${padStart(minutes, 2)}`;
|
||||
return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
|
||||
case "narrow":
|
||||
return minutes > 0 ? `${base}:${minutes}` : base;
|
||||
return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
|
||||
case "techie":
|
||||
return `${sign}${padStart(Math.abs(hours), 2)}${padStart(minutes, 2)}`;
|
||||
return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
|
||||
default:
|
||||
throw new RangeError(`Value format ${format} is out of range for property format`);
|
||||
}
|
||||
|
|
4
node_modules/luxon/src/info.js
generated
vendored
4
node_modules/luxon/src/info.js
generated
vendored
|
@ -95,7 +95,7 @@ export default class Info {
|
|||
/**
|
||||
* Return an array of standalone week names.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
@ -114,7 +114,7 @@ export default class Info {
|
|||
* 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 {@link weekdays}
|
||||
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
|
||||
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
|
||||
* @param {Object} opts - options
|
||||
* @param {string} [opts.locale=null] - the locale code
|
||||
* @param {string} [opts.numberingSystem=null] - the numbering system
|
||||
|
|
27
node_modules/luxon/src/interval.js
generated
vendored
27
node_modules/luxon/src/interval.js
generated
vendored
|
@ -31,7 +31,7 @@ function validateStartEnd(start, end) {
|
|||
* * **Accessors** Use {@link start} and {@link end} to get the start and end.
|
||||
* * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.
|
||||
* * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}
|
||||
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}.
|
||||
* * **Output** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toISODate}, {@link toISOTime}, {@link toFormat}, and {@link toDuration}.
|
||||
*/
|
||||
export default class Interval {
|
||||
|
@ -134,19 +134,32 @@ export default class Interval {
|
|||
static fromISO(text, opts) {
|
||||
const [s, e] = (text || "").split("/", 2);
|
||||
if (s && e) {
|
||||
const start = DateTime.fromISO(s, opts),
|
||||
end = DateTime.fromISO(e, opts);
|
||||
let start, startIsValid;
|
||||
try {
|
||||
start = DateTime.fromISO(s, opts);
|
||||
startIsValid = start.isValid;
|
||||
} catch (e) {
|
||||
startIsValid = false;
|
||||
}
|
||||
|
||||
if (start.isValid && end.isValid) {
|
||||
let end, endIsValid;
|
||||
try {
|
||||
end = DateTime.fromISO(e, opts);
|
||||
endIsValid = end.isValid;
|
||||
} catch (e) {
|
||||
endIsValid = false;
|
||||
}
|
||||
|
||||
if (startIsValid && endIsValid) {
|
||||
return Interval.fromDateTimes(start, end);
|
||||
}
|
||||
|
||||
if (start.isValid) {
|
||||
if (startIsValid) {
|
||||
const dur = Duration.fromISO(e, opts);
|
||||
if (dur.isValid) {
|
||||
return Interval.after(start, dur);
|
||||
}
|
||||
} else if (end.isValid) {
|
||||
} else if (endIsValid) {
|
||||
const dur = Duration.fromISO(s, opts);
|
||||
if (dur.isValid) {
|
||||
return Interval.before(end, dur);
|
||||
|
@ -234,7 +247,7 @@ export default class Interval {
|
|||
* @return {boolean}
|
||||
*/
|
||||
hasSame(unit) {
|
||||
return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue