date-fns
Version:
Modern JavaScript date utility library
808 lines (769 loc) • 237 kB
JavaScript
(() => {
function _createForOfIteratorHelper(o, allowArrayLike) {var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = it.call(o);}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === "object" || typeof call === "function")) {return call;} else if (call !== void 0) {throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, "prototype", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, "prototype", { writable: false });return Constructor;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _toArray(arr) {return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;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 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/index.js
var exports_lib = {};
__export(exports_lib, {
yearsToQuarters: function yearsToQuarters() {return _yearsToQuarters;},
yearsToMonths: function yearsToMonths() {return _yearsToMonths;},
yearsToDays: function yearsToDays() {return _yearsToDays;},
weeksToDays: function weeksToDays() {return _weeksToDays;},
transpose: function transpose() {return _transpose;},
toDate: function toDate() {return _toDate;},
subYears: function subYears() {return _subYears;},
subWeeks: function subWeeks() {return _subWeeks;},
subSeconds: function subSeconds() {return _subSeconds;},
subQuarters: function subQuarters() {return _subQuarters;},
subMonths: function subMonths() {return _subMonths;},
subMinutes: function subMinutes() {return _subMinutes;},
subMilliseconds: function subMilliseconds() {return _subMilliseconds;},
subISOWeekYears: function subISOWeekYears() {return _subISOWeekYears;},
subHours: function subHours() {return _subHours;},
subDays: function subDays() {return _subDays;},
subBusinessDays: function subBusinessDays() {return _subBusinessDays;},
sub: function sub() {return _sub;},
startOfYesterday: function startOfYesterday() {return _startOfYesterday;},
startOfYear: function startOfYear() {return _startOfYear;},
startOfWeekYear: function startOfWeekYear() {return _startOfWeekYear;},
startOfWeek: function startOfWeek() {return _startOfWeek;},
startOfTomorrow: function startOfTomorrow() {return _startOfTomorrow;},
startOfToday: function startOfToday() {return _startOfToday;},
startOfSecond: function startOfSecond() {return _startOfSecond;},
startOfQuarter: function startOfQuarter() {return _startOfQuarter;},
startOfMonth: function startOfMonth() {return _startOfMonth;},
startOfMinute: function startOfMinute() {return _startOfMinute;},
startOfISOWeekYear: function startOfISOWeekYear() {return _startOfISOWeekYear;},
startOfISOWeek: function startOfISOWeek() {return _startOfISOWeek;},
startOfHour: function startOfHour() {return _startOfHour;},
startOfDecade: function startOfDecade() {return _startOfDecade;},
startOfDay: function startOfDay() {return _startOfDay;},
setYear: function setYear() {return _setYear;},
setWeekYear: function setWeekYear() {return _setWeekYear;},
setWeek: function setWeek() {return _setWeek;},
setSeconds: function setSeconds() {return _setSeconds;},
setQuarter: function setQuarter() {return _setQuarter;},
setMonth: function setMonth() {return _setMonth;},
setMinutes: function setMinutes() {return _setMinutes;},
setMilliseconds: function setMilliseconds() {return _setMilliseconds;},
setISOWeekYear: function setISOWeekYear() {return _setISOWeekYear;},
setISOWeek: function setISOWeek() {return _setISOWeek;},
setISODay: function setISODay() {return _setISODay;},
setHours: function setHours() {return _setHours;},
setDefaultOptions: function setDefaultOptions() {return setDefaultOptions2;},
setDayOfYear: function setDayOfYear() {return _setDayOfYear;},
setDay: function setDay() {return _setDay;},
setDate: function setDate() {return _setDate;},
set: function set() {return _set;},
secondsToMinutes: function secondsToMinutes() {return _secondsToMinutes;},
secondsToMilliseconds: function secondsToMilliseconds() {return _secondsToMilliseconds;},
secondsToHours: function secondsToHours() {return _secondsToHours;},
roundToNearestMinutes: function roundToNearestMinutes() {return _roundToNearestMinutes;},
roundToNearestHours: function roundToNearestHours() {return _roundToNearestHours;},
quartersToYears: function quartersToYears() {return _quartersToYears;},
quartersToMonths: function quartersToMonths() {return _quartersToMonths;},
previousWednesday: function previousWednesday() {return _previousWednesday;},
previousTuesday: function previousTuesday() {return _previousTuesday;},
previousThursday: function previousThursday() {return _previousThursday;},
previousSunday: function previousSunday() {return _previousSunday;},
previousSaturday: function previousSaturday() {return _previousSaturday;},
previousMonday: function previousMonday() {return _previousMonday;},
previousFriday: function previousFriday() {return _previousFriday;},
previousDay: function previousDay() {return _previousDay;},
parsers: function parsers() {return _parsers;},
parseJSON: function parseJSON() {return _parseJSON;},
parseISO: function parseISO() {return _parseISO;},
parse: function parse() {return _parse;},
nextWednesday: function nextWednesday() {return _nextWednesday;},
nextTuesday: function nextTuesday() {return _nextTuesday;},
nextThursday: function nextThursday() {return _nextThursday;},
nextSunday: function nextSunday() {return _nextSunday;},
nextSaturday: function nextSaturday() {return _nextSaturday;},
nextMonday: function nextMonday() {return _nextMonday;},
nextFriday: function nextFriday() {return _nextFriday;},
nextDay: function nextDay() {return _nextDay;},
monthsToYears: function monthsToYears() {return _monthsToYears;},
monthsToQuarters: function monthsToQuarters() {return _monthsToQuarters;},
minutesToSeconds: function minutesToSeconds() {return _minutesToSeconds;},
minutesToMilliseconds: function minutesToMilliseconds() {return _minutesToMilliseconds;},
minutesToHours: function minutesToHours() {return _minutesToHours;},
min: function min() {return _min;},
millisecondsToSeconds: function millisecondsToSeconds() {return _millisecondsToSeconds;},
millisecondsToMinutes: function millisecondsToMinutes() {return _millisecondsToMinutes;},
millisecondsToHours: function millisecondsToHours() {return _millisecondsToHours;},
milliseconds: function milliseconds() {return _milliseconds;},
max: function max() {return _max;},
longFormatters: function longFormatters() {return _longFormatters;},
lightFormatters: function lightFormatters() {return _lightFormatters;},
lightFormat: function lightFormat() {return _lightFormat;},
lastDayOfYear: function lastDayOfYear() {return _lastDayOfYear;},
lastDayOfWeek: function lastDayOfWeek() {return _lastDayOfWeek;},
lastDayOfQuarter: function lastDayOfQuarter() {return _lastDayOfQuarter;},
lastDayOfMonth: function lastDayOfMonth() {return _lastDayOfMonth;},
lastDayOfISOWeekYear: function lastDayOfISOWeekYear() {return _lastDayOfISOWeekYear;},
lastDayOfISOWeek: function lastDayOfISOWeek() {return _lastDayOfISOWeek;},
lastDayOfDecade: function lastDayOfDecade() {return _lastDayOfDecade;},
isYesterday: function isYesterday() {return _isYesterday;},
isWithinInterval: function isWithinInterval() {return _isWithinInterval;},
isWeekend: function isWeekend() {return _isWeekend;},
isWednesday: function isWednesday() {return _isWednesday;},
isValid: function isValid() {return _isValid;},
isTuesday: function isTuesday() {return _isTuesday;},
isTomorrow: function isTomorrow() {return _isTomorrow;},
isToday: function isToday() {return _isToday;},
isThursday: function isThursday() {return _isThursday;},
isThisYear: function isThisYear() {return _isThisYear;},
isThisWeek: function isThisWeek() {return _isThisWeek;},
isThisSecond: function isThisSecond() {return _isThisSecond;},
isThisQuarter: function isThisQuarter() {return _isThisQuarter;},
isThisMonth: function isThisMonth() {return _isThisMonth;},
isThisMinute: function isThisMinute() {return _isThisMinute;},
isThisISOWeek: function isThisISOWeek() {return _isThisISOWeek;},
isThisHour: function isThisHour() {return _isThisHour;},
isSunday: function isSunday() {return _isSunday;},
isSaturday: function isSaturday() {return _isSaturday;},
isSameYear: function isSameYear() {return _isSameYear;},
isSameWeek: function isSameWeek() {return _isSameWeek;},
isSameSecond: function isSameSecond() {return _isSameSecond;},
isSameQuarter: function isSameQuarter() {return _isSameQuarter;},
isSameMonth: function isSameMonth() {return _isSameMonth;},
isSameMinute: function isSameMinute() {return _isSameMinute;},
isSameISOWeekYear: function isSameISOWeekYear() {return _isSameISOWeekYear;},
isSameISOWeek: function isSameISOWeek() {return _isSameISOWeek;},
isSameHour: function isSameHour() {return _isSameHour;},
isSameDay: function isSameDay() {return _isSameDay;},
isPast: function isPast() {return _isPast;},
isMonday: function isMonday() {return _isMonday;},
isMatch: function isMatch() {return _isMatch;},
isLeapYear: function isLeapYear() {return _isLeapYear;},
isLastDayOfMonth: function isLastDayOfMonth() {return _isLastDayOfMonth;},
isFuture: function isFuture() {return _isFuture;},
isFriday: function isFriday() {return _isFriday;},
isFirstDayOfMonth: function isFirstDayOfMonth() {return _isFirstDayOfMonth;},
isExists: function isExists() {return _isExists;},
isEqual: function isEqual() {return _isEqual;},
isDate: function isDate() {return _isDate;},
isBefore: function isBefore() {return _isBefore;},
isAfter: function isAfter() {return _isAfter;},
intlFormatDistance: function intlFormatDistance() {return _intlFormatDistance;},
intlFormat: function intlFormat() {return _intlFormat;},
intervalToDuration: function intervalToDuration() {return _intervalToDuration;},
interval: function interval() {return _interval;},
hoursToSeconds: function hoursToSeconds() {return _hoursToSeconds;},
hoursToMinutes: function hoursToMinutes() {return _hoursToMinutes;},
hoursToMilliseconds: function hoursToMilliseconds() {return _hoursToMilliseconds;},
getYear: function getYear() {return _getYear;},
getWeeksInMonth: function getWeeksInMonth() {return _getWeeksInMonth;},
getWeekYear: function getWeekYear() {return _getWeekYear;},
getWeekOfMonth: function getWeekOfMonth() {return _getWeekOfMonth;},
getWeek: function getWeek() {return _getWeek;},
getUnixTime: function getUnixTime() {return _getUnixTime;},
getTime: function getTime() {return _getTime;},
getSeconds: function getSeconds() {return _getSeconds;},
getQuarter: function getQuarter() {return _getQuarter;},
getOverlappingDaysInIntervals: function getOverlappingDaysInIntervals() {return _getOverlappingDaysInIntervals;},
getMonth: function getMonth() {return _getMonth;},
getMinutes: function getMinutes() {return _getMinutes;},
getMilliseconds: function getMilliseconds() {return _getMilliseconds;},
getISOWeeksInYear: function getISOWeeksInYear() {return _getISOWeeksInYear;},
getISOWeekYear: function getISOWeekYear() {return _getISOWeekYear;},
getISOWeek: function getISOWeek() {return _getISOWeek;},
getISODay: function getISODay() {return _getISODay;},
getHours: function getHours() {return _getHours;},
getDefaultOptions: function getDefaultOptions() {return getDefaultOptions2;},
getDecade: function getDecade() {return _getDecade;},
getDaysInYear: function getDaysInYear() {return _getDaysInYear;},
getDaysInMonth: function getDaysInMonth() {return _getDaysInMonth;},
getDayOfYear: function getDayOfYear() {return _getDayOfYear;},
getDay: function getDay() {return _getDay;},
getDate: function getDate() {return _getDate;},
fromUnixTime: function fromUnixTime() {return _fromUnixTime;},
formatters: function formatters() {return _formatters;},
formatRelative: function formatRelative() {return formatRelative3;},
formatRFC7231: function formatRFC7231() {return _formatRFC;},
formatRFC3339: function formatRFC3339() {return _formatRFC2;},
formatISODuration: function formatISODuration() {return _formatISODuration;},
formatISO9075: function formatISO9075() {return _formatISO;},
formatISO: function formatISO() {return _formatISO2;},
formatDuration: function formatDuration() {return _formatDuration;},
formatDistanceToNowStrict: function formatDistanceToNowStrict() {return _formatDistanceToNowStrict;},
formatDistanceToNow: function formatDistanceToNow() {return _formatDistanceToNow;},
formatDistanceStrict: function formatDistanceStrict() {return _formatDistanceStrict;},
formatDistance: function formatDistance() {return formatDistance3;},
formatDate: function formatDate() {return _format;},
format: function format() {return _format;},
endOfYesterday: function endOfYesterday() {return _endOfYesterday;},
endOfYear: function endOfYear() {return _endOfYear;},
endOfWeek: function endOfWeek() {return _endOfWeek;},
endOfTomorrow: function endOfTomorrow() {return _endOfTomorrow;},
endOfToday: function endOfToday() {return _endOfToday;},
endOfSecond: function endOfSecond() {return _endOfSecond;},
endOfQuarter: function endOfQuarter() {return _endOfQuarter;},
endOfMonth: function endOfMonth() {return _endOfMonth;},
endOfMinute: function endOfMinute() {return _endOfMinute;},
endOfISOWeekYear: function endOfISOWeekYear() {return _endOfISOWeekYear;},
endOfISOWeek: function endOfISOWeek() {return _endOfISOWeek;},
endOfHour: function endOfHour() {return _endOfHour;},
endOfDecade: function endOfDecade() {return _endOfDecade;},
endOfDay: function endOfDay() {return _endOfDay;},
eachYearOfInterval: function eachYearOfInterval() {return _eachYearOfInterval;},
eachWeekendOfYear: function eachWeekendOfYear() {return _eachWeekendOfYear;},
eachWeekendOfMonth: function eachWeekendOfMonth() {return _eachWeekendOfMonth;},
eachWeekendOfInterval: function eachWeekendOfInterval() {return _eachWeekendOfInterval;},
eachWeekOfInterval: function eachWeekOfInterval() {return _eachWeekOfInterval;},
eachQuarterOfInterval: function eachQuarterOfInterval() {return _eachQuarterOfInterval;},
eachMonthOfInterval: function eachMonthOfInterval() {return _eachMonthOfInterval;},
eachMinuteOfInterval: function eachMinuteOfInterval() {return _eachMinuteOfInterval;},
eachHourOfInterval: function eachHourOfInterval() {return _eachHourOfInterval;},
eachDayOfInterval: function eachDayOfInterval() {return _eachDayOfInterval;},
differenceInYears: function differenceInYears() {return _differenceInYears;},
differenceInWeeks: function differenceInWeeks() {return _differenceInWeeks;},
differenceInSeconds: function differenceInSeconds() {return _differenceInSeconds;},
differenceInQuarters: function differenceInQuarters() {return _differenceInQuarters;},
differenceInMonths: function differenceInMonths() {return _differenceInMonths;},
differenceInMinutes: function differenceInMinutes() {return _differenceInMinutes;},
differenceInMilliseconds: function differenceInMilliseconds() {return _differenceInMilliseconds;},
differenceInISOWeekYears: function differenceInISOWeekYears() {return _differenceInISOWeekYears;},
differenceInHours: function differenceInHours() {return _differenceInHours;},
differenceInDays: function differenceInDays() {return _differenceInDays;},
differenceInCalendarYears: function differenceInCalendarYears() {return _differenceInCalendarYears;},
differenceInCalendarWeeks: function differenceInCalendarWeeks() {return _differenceInCalendarWeeks;},
differenceInCalendarQuarters: function differenceInCalendarQuarters() {return _differenceInCalendarQuarters;},
differenceInCalendarMonths: function differenceInCalendarMonths() {return _differenceInCalendarMonths;},
differenceInCalendarISOWeeks: function differenceInCalendarISOWeeks() {return _differenceInCalendarISOWeeks;},
differenceInCalendarISOWeekYears: function differenceInCalendarISOWeekYears() {return _differenceInCalendarISOWeekYears;},
differenceInCalendarDays: function differenceInCalendarDays() {return _differenceInCalendarDays;},
differenceInBusinessDays: function differenceInBusinessDays() {return _differenceInBusinessDays;},
daysToWeeks: function daysToWeeks() {return _daysToWeeks;},
constructNow: function constructNow() {return _constructNow;},
constructFrom: function constructFrom() {return _constructFrom;},
compareDesc: function compareDesc() {return _compareDesc;},
compareAsc: function compareAsc() {return _compareAsc;},
closestTo: function closestTo() {return _closestTo;},
closestIndexTo: function closestIndexTo() {return _closestIndexTo;},
clamp: function clamp() {return _clamp;},
areIntervalsOverlapping: function areIntervalsOverlapping() {return _areIntervalsOverlapping;},
addYears: function addYears() {return _addYears;},
addWeeks: function addWeeks() {return _addWeeks;},
addSeconds: function addSeconds() {return _addSeconds;},
addQuarters: function addQuarters() {return _addQuarters;},
addMonths: function addMonths() {return _addMonths;},
addMinutes: function addMinutes() {return _addMinutes;},
addMilliseconds: function addMilliseconds() {return _addMilliseconds;},
addISOWeekYears: function addISOWeekYears() {return _addISOWeekYears;},
addHours: function addHours() {return _addHours;},
addDays: function addDays() {return _addDays;},
addBusinessDays: function addBusinessDays() {return _addBusinessDays;},
add: function add() {return _add;}
});
// lib/constants.js
var daysInWeek = 7;
var daysInYear = 365.2425;
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
var minTime = -maxTime;
var millisecondsInWeek = 604800000;
var millisecondsInDay = 86400000;
var millisecondsInMinute = 60000;
var millisecondsInHour = 3600000;
var millisecondsInSecond = 1000;
var minutesInYear = 525600;
var minutesInMonth = 43200;
var minutesInDay = 1440;
var minutesInHour = 60;
var monthsInQuarter = 3;
var monthsInYear = 12;
var quartersInYear = 4;
var secondsInHour = 3600;
var secondsInMinute = 60;
var secondsInDay = secondsInHour * 24;
var secondsInWeek = secondsInDay * 7;
var secondsInYear = secondsInDay * daysInYear;
var secondsInMonth = secondsInYear / 12;
var secondsInQuarter = secondsInMonth * 3;
var constructFromSymbol = Symbol.for("constructDateFrom");
// lib/constructFrom.js
function _constructFrom(date, value) {
if (typeof date === "function")
return date(value);
if (date && _typeof(date) === "object" && constructFromSymbol in date)
return date[constructFromSymbol](value);
if (date instanceof Date)
return new date.constructor(value);
return new Date(value);
}
// lib/toDate.js
function _toDate(argument, context) {
return _constructFrom(context || argument, argument);
}
// lib/addDays.js
function _addDays(date, amount, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
if (isNaN(amount))
return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
if (!amount)
return _date;
_date.setDate(_date.getDate() + amount);
return _date;
}
// lib/addMonths.js
function _addMonths(date, amount, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
if (isNaN(amount))
return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
if (!amount) {
return _date;
}
var dayOfMonth = _date.getDate();
var endOfDesiredMonth = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, _date.getTime());
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
var daysInMonth = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth) {
return endOfDesiredMonth;
} else {
_date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
return _date;
}
}
// lib/add.js
function _add(date, duration, options) {
var _duration$years =
duration.years,years = _duration$years === void 0 ? 0 : _duration$years,_duration$months = duration.months,months = _duration$months === void 0 ? 0 : _duration$months,_duration$weeks = duration.weeks,weeks = _duration$weeks === void 0 ? 0 : _duration$weeks,_duration$days = duration.days,days = _duration$days === void 0 ? 0 : _duration$days,_duration$hours = duration.hours,hours = _duration$hours === void 0 ? 0 : _duration$hours,_duration$minutes = duration.minutes,minutes = _duration$minutes === void 0 ? 0 : _duration$minutes,_duration$seconds = duration.seconds,seconds = _duration$seconds === void 0 ? 0 : _duration$seconds;
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var dateWithMonths = months || years ? _addMonths(_date, months + years * 12) : _date;
var dateWithDays = days || weeks ? _addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
var minutesToAdd = minutes + hours * 60;
var secondsToAdd = seconds + minutesToAdd * 60;
var msToAdd = secondsToAdd * 1000;
return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +dateWithDays + msToAdd);
}
// lib/isSaturday.js
function _isSaturday(date, options) {
return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 6;
}
// lib/isSunday.js
function _isSunday(date, options) {
return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 0;
}
// lib/isWeekend.js
function _isWeekend(date, options) {
var day = _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
return day === 0 || day === 6;
}
// lib/addBusinessDays.js
function _addBusinessDays(date, amount, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var startedOnWeekend = _isWeekend(_date, options);
if (isNaN(amount))
return _constructFrom(options === null || options === void 0 ? void 0 : options.in, NaN);
var hours = _date.getHours();
var sign = amount < 0 ? -1 : 1;
var fullWeeks = Math.trunc(amount / 5);
_date.setDate(_date.getDate() + fullWeeks * 7);
var restDays = Math.abs(amount % 5);
while (restDays > 0) {
_date.setDate(_date.getDate() + sign);
if (!_isWeekend(_date, options))
restDays -= 1;
}
if (startedOnWeekend && _isWeekend(_date, options) && amount !== 0) {
if (_isSaturday(_date, options))
_date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
if (_isSunday(_date, options))
_date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
}
_date.setHours(hours);
return _date;
}
// lib/addMilliseconds.js
function _addMilliseconds(date, amount, options) {
return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +_toDate(date) + amount);
}
// lib/addHours.js
function _addHours(date, amount, options) {
return _addMilliseconds(date, amount * millisecondsInHour, options);
}
// lib/_lib/defaultOptions.js
function getDefaultOptions() {
return defaultOptions;
}
function setDefaultOptions(newOptions) {
defaultOptions = newOptions;
}
var defaultOptions = {};
// lib/startOfWeek.js
function _startOfWeek(date, options) {var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _defaultOptions3$loca;
var defaultOptions3 = getDefaultOptions();
var weekStartsOn = (_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions3$loca = defaultOptions3.locale) === null || _defaultOptions3$loca === void 0 || (_defaultOptions3$loca = _defaultOptions3$loca.options) === null || _defaultOptions3$loca === void 0 ? void 0 : _defaultOptions3$loca.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0;
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var day = _date.getDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
_date.setDate(_date.getDate() - diff);
_date.setHours(0, 0, 0, 0);
return _date;
}
// lib/startOfISOWeek.js
function _startOfISOWeek(date, options) {
return _startOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
}
// lib/getISOWeekYear.js
function _getISOWeekYear(date, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var year = _date.getFullYear();
var fourthOfJanuaryOfNextYear = _constructFrom(_date, 0);
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
var startOfNextYear = _startOfISOWeek(fourthOfJanuaryOfNextYear);
var fourthOfJanuaryOfThisYear = _constructFrom(_date, 0);
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
var startOfThisYear = _startOfISOWeek(fourthOfJanuaryOfThisYear);
if (_date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (_date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
// lib/_lib/getTimezoneOffsetInMilliseconds.js
function getTimezoneOffsetInMilliseconds(date) {
var _date = _toDate(date);
var utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
utcDate.setUTCFullYear(_date.getFullYear());
return +date - +utcDate;
}
// lib/_lib/normalizeDates.js
function normalizeDates(context) {for (var _len = arguments.length, dates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {dates[_key - 1] = arguments[_key];}
var normalize = _constructFrom.bind(null, context || dates.find(function (date) {return _typeof(date) === "object";}));
return dates.map(normalize);
}
// lib/startOfDay.js
function _startOfDay(date, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
_date.setHours(0, 0, 0, 0);
return _date;
}
// lib/differenceInCalendarDays.js
function _differenceInCalendarDays(laterDate, earlierDate, options) {
var _normalizeDates = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates2 = _slicedToArray(_normalizeDates, 2),laterDate_ = _normalizeDates2[0],earlierDate_ = _normalizeDates2[1];
var laterStartOfDay = _startOfDay(laterDate_);
var earlierStartOfDay = _startOfDay(earlierDate_);
var laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
var earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
}
// lib/startOfISOWeekYear.js
function _startOfISOWeekYear(date, options) {
var year = _getISOWeekYear(date, options);
var fourthOfJanuary = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
fourthOfJanuary.setFullYear(year, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
return _startOfISOWeek(fourthOfJanuary);
}
// lib/setISOWeekYear.js
function _setISOWeekYear(date, weekYear, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var diff = _differenceInCalendarDays(_date, _startOfISOWeekYear(_date, options));
var fourthOfJanuary = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
fourthOfJanuary.setFullYear(weekYear, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
_date = _startOfISOWeekYear(fourthOfJanuary);
_date.setDate(_date.getDate() + diff);
return _date;
}
// lib/addISOWeekYears.js
function _addISOWeekYears(date, amount, options) {
return _setISOWeekYear(date, _getISOWeekYear(date, options) + amount, options);
}
// lib/addMinutes.js
function _addMinutes(date, amount, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
_date.setTime(_date.getTime() + amount * millisecondsInMinute);
return _date;
}
// lib/addQuarters.js
function _addQuarters(date, amount, options) {
return _addMonths(date, amount * 3, options);
}
// lib/addSeconds.js
function _addSeconds(date, amount, options) {
return _addMilliseconds(date, amount * 1000, options);
}
// lib/addWeeks.js
function _addWeeks(date, amount, options) {
return _addDays(date, amount * 7, options);
}
// lib/addYears.js
function _addYears(date, amount, options) {
return _addMonths(date, amount * 12, options);
}
// lib/areIntervalsOverlapping.js
function _areIntervalsOverlapping(intervalLeft, intervalRight, options) {
var _sort = [
+_toDate(intervalLeft.start, options === null || options === void 0 ? void 0 : options.in),
+_toDate(intervalLeft.end, options === null || options === void 0 ? void 0 : options.in)].
sort(function (a, b) {return a - b;}),_sort2 = _slicedToArray(_sort, 2),leftStartTime = _sort2[0],leftEndTime = _sort2[1];
var _sort3 = [
+_toDate(intervalRight.start, options === null || options === void 0 ? void 0 : options.in),
+_toDate(intervalRight.end, options === null || options === void 0 ? void 0 : options.in)].
sort(function (a, b) {return a - b;}),_sort4 = _slicedToArray(_sort3, 2),rightStartTime = _sort4[0],rightEndTime = _sort4[1];
if (options !== null && options !== void 0 && options.inclusive)
return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
}
// lib/max.js
function _max(dates, options) {
var result;
var context = options === null || options === void 0 ? void 0 : options.in;
dates.forEach(function (date) {
if (!context && _typeof(date) === "object")
context = _constructFrom.bind(null, date);
var date_ = _toDate(date, context);
if (!result || result < date_ || isNaN(+date_))
result = date_;
});
return _constructFrom(context, result || NaN);
}
// lib/min.js
function _min(dates, options) {
var result;
var context = options === null || options === void 0 ? void 0 : options.in;
dates.forEach(function (date) {
if (!context && _typeof(date) === "object")
context = _constructFrom.bind(null, date);
var date_ = _toDate(date, context);
if (!result || result > date_ || isNaN(+date_))
result = date_;
});
return _constructFrom(context, result || NaN);
}
// lib/clamp.js
function _clamp(date, interval, options) {
var _normalizeDates3 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, date, interval.start, interval.end),_normalizeDates4 = _slicedToArray(_normalizeDates3, 3),date_ = _normalizeDates4[0],start = _normalizeDates4[1],end = _normalizeDates4[2];
return _min([_max([date_, start], options), end], options);
}
// lib/closestIndexTo.js
function _closestIndexTo(dateToCompare, dates) {
var timeToCompare = +_toDate(dateToCompare);
if (isNaN(timeToCompare))
return NaN;
var result;
var minDistance;
dates.forEach(function (date, index) {
var date_ = _toDate(date);
if (isNaN(+date_)) {
result = NaN;
minDistance = NaN;
return;
}
var distance = Math.abs(timeToCompare - +date_);
if (result == null || distance < minDistance) {
result = index;
minDistance = distance;
}
});
return result;
}
// lib/closestTo.js
function _closestTo(dateToCompare, dates, options) {
var _normalizeDates5 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in, dateToCompare].concat(_toConsumableArray(dates))),_normalizeDates6 = _toArray(_normalizeDates5),dateToCompare_ = _normalizeDates6[0],dates_ = _normalizeDates6.slice(1);
var index = _closestIndexTo(dateToCompare_, dates_);
if (typeof index === "number" && isNaN(index))
return _constructFrom(dateToCompare_, NaN);
if (index !== undefined)
return dates_[index];
}
// lib/compareAsc.js
function _compareAsc(dateLeft, dateRight) {
var diff = +_toDate(dateLeft) - +_toDate(dateRight);
if (diff < 0)
return -1;else
if (diff > 0)
return 1;
return diff;
}
// lib/compareDesc.js
function _compareDesc(dateLeft, dateRight) {
var diff = +_toDate(dateLeft) - +_toDate(dateRight);
if (diff > 0)
return -1;else
if (diff < 0)
return 1;
return diff;
}
// lib/constructNow.js
function _constructNow(date) {
return _constructFrom(date, Date.now());
}
// lib/daysToWeeks.js
function _daysToWeeks(days) {
var result = Math.trunc(days / daysInWeek);
return result === 0 ? 0 : result;
}
// lib/isSameDay.js
function _isSameDay(laterDate, earlierDate, options) {
var _normalizeDates7 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates8 = _slicedToArray(_normalizeDates7, 2),dateLeft_ = _normalizeDates8[0],dateRight_ = _normalizeDates8[1];
return +_startOfDay(dateLeft_) === +_startOfDay(dateRight_);
}
// lib/isDate.js
function _isDate(value) {
return value instanceof Date || _typeof(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
}
// lib/isValid.js
function _isValid(date) {
return !(!_isDate(date) && typeof date !== "number" || isNaN(+_toDate(date)));
}
// lib/differenceInBusinessDays.js
function _differenceInBusinessDays(laterDate, earlierDate, options) {
var _normalizeDates9 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates10 = _slicedToArray(_normalizeDates9, 2),laterDate_ = _normalizeDates10[0],earlierDate_ = _normalizeDates10[1];
if (!_isValid(laterDate_) || !_isValid(earlierDate_))
return NaN;
var diff = _differenceInCalendarDays(laterDate_, earlierDate_);
var sign = diff < 0 ? -1 : 1;
var weeks = Math.trunc(diff / 7);
var result = weeks * 5;
var movingDate = _addDays(earlierDate_, weeks * 7);
while (!_isSameDay(laterDate_, movingDate)) {
result += _isWeekend(movingDate, options) ? 0 : sign;
movingDate = _addDays(movingDate, sign);
}
return result === 0 ? 0 : result;
}
// lib/differenceInCalendarISOWeekYears.js
function _differenceInCalendarISOWeekYears(laterDate, earlierDate, options) {
var _normalizeDates11 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates12 = _slicedToArray(_normalizeDates11, 2),laterDate_ = _normalizeDates12[0],earlierDate_ = _normalizeDates12[1];
return _getISOWeekYear(laterDate_, options) - _getISOWeekYear(earlierDate_, options);
}
// lib/differenceInCalendarISOWeeks.js
function _differenceInCalendarISOWeeks(laterDate, earlierDate, options) {
var _normalizeDates13 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates14 = _slicedToArray(_normalizeDates13, 2),laterDate_ = _normalizeDates14[0],earlierDate_ = _normalizeDates14[1];
var startOfISOWeekLeft = _startOfISOWeek(laterDate_);
var startOfISOWeekRight = _startOfISOWeek(earlierDate_);
var timestampLeft = +startOfISOWeekLeft - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);
var timestampRight = +startOfISOWeekRight - getTimezoneOffsetInMilliseconds(startOfISOWeekRight);
return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);
}
// lib/differenceInCalendarMonths.js
function _differenceInCalendarMonths(laterDate, earlierDate, options) {
var _normalizeDates15 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates16 = _slicedToArray(_normalizeDates15, 2),laterDate_ = _normalizeDates16[0],earlierDate_ = _normalizeDates16[1];
var yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
var monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
return yearsDiff * 12 + monthsDiff;
}
// lib/getQuarter.js
function _getQuarter(date, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var quarter = Math.trunc(_date.getMonth() / 3) + 1;
return quarter;
}
// lib/differenceInCalendarQuarters.js
function _differenceInCalendarQuarters(laterDate, earlierDate, options) {
var _normalizeDates17 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates18 = _slicedToArray(_normalizeDates17, 2),laterDate_ = _normalizeDates18[0],earlierDate_ = _normalizeDates18[1];
var yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
var quartersDiff = _getQuarter(laterDate_) - _getQuarter(earlierDate_);
return yearsDiff * 4 + quartersDiff;
}
// lib/differenceInCalendarWeeks.js
function _differenceInCalendarWeeks(laterDate, earlierDate, options) {
var _normalizeDates19 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates20 = _slicedToArray(_normalizeDates19, 2),laterDate_ = _normalizeDates20[0],earlierDate_ = _normalizeDates20[1];
var laterStartOfWeek = _startOfWeek(laterDate_, options);
var earlierStartOfWeek = _startOfWeek(earlierDate_, options);
var laterTimestamp = +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);
var earlierTimestamp = +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);
}
// lib/differenceInCalendarYears.js
function _differenceInCalendarYears(laterDate, earlierDate, options) {
var _normalizeDates21 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates22 = _slicedToArray(_normalizeDates21, 2),laterDate_ = _normalizeDates22[0],earlierDate_ = _normalizeDates22[1];
return laterDate_.getFullYear() - earlierDate_.getFullYear();
}
// lib/differenceInDays.js
function _differenceInDays(laterDate, earlierDate, options) {
var _normalizeDates23 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates24 = _slicedToArray(_normalizeDates23, 2),laterDate_ = _normalizeDates24[0],earlierDate_ = _normalizeDates24[1];
var sign = compareLocalAsc(laterDate_, earlierDate_);
var difference = Math.abs(_differenceInCalendarDays(laterDate_, earlierDate_));
laterDate_.setDate(laterDate_.getDate() - sign * difference);
var isLastDayNotFull = Number(compareLocalAsc(laterDate_, earlierDate_) === -sign);
var result = sign * (difference - isLastDayNotFull);
return result === 0 ? 0 : result;
}
function compareLocalAsc(laterDate, earlierDate) {
var diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();
if (diff < 0)
return -1;
if (diff > 0)
return 1;
return diff;
}
// lib/_lib/getRoundingMethod.js
function getRoundingMethod(method) {
return function (number) {
var round = method ? Math[method] : Math.trunc;
var result = round(number);
return result === 0 ? 0 : result;
};
}
// lib/differenceInHours.js
function _differenceInHours(laterDate, earlierDate, options) {
var _normalizeDates25 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates26 = _slicedToArray(_normalizeDates25, 2),laterDate_ = _normalizeDates26[0],earlierDate_ = _normalizeDates26[1];
var diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
// lib/subISOWeekYears.js
function _subISOWeekYears(date, amount, options) {
return _addISOWeekYears(date, -amount, options);
}
// lib/differenceInISOWeekYears.js
function _differenceInISOWeekYears(laterDate, earlierDate, options) {
var _normalizeDates27 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates28 = _slicedToArray(_normalizeDates27, 2),laterDate_ = _normalizeDates28[0],earlierDate_ = _normalizeDates28[1];
var sign = _compareAsc(laterDate_, earlierDate_);
var diff = Math.abs(_differenceInCalendarISOWeekYears(laterDate_, earlierDate_, options));
var adjustedDate = _subISOWeekYears(laterDate_, sign * diff, options);
var isLastISOWeekYearNotFull = Number(_compareAsc(adjustedDate, earlierDate_) === -sign);
var result = sign * (diff - isLastISOWeekYearNotFull);
return result === 0 ? 0 : result;
}
// lib/differenceInMilliseconds.js
function _differenceInMilliseconds(laterDate, earlierDate) {
return +_toDate(laterDate) - +_toDate(earlierDate);
}
// lib/differenceInMinutes.js
function _differenceInMinutes(dateLeft, dateRight, options) {
var diff = _differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
// lib/endOfDay.js
function _endOfDay(date, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
_date.setHours(23, 59, 59, 999);
return _date;
}
// lib/endOfMonth.js
function _endOfMonth(date, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
var month = _date.getMonth();
_date.setFullYear(_date.getFullYear(), month + 1, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}
// lib/isLastDayOfMonth.js
function _isLastDayOfMonth(date, options) {
var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
return +_endOfDay(_date, options) === +_endOfMonth(_date, options);
}
// lib/differenceInMonths.js
function _differenceInMonths(laterDate, earlierDate, options) {
var _normalizeDates29 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, laterDate, earlierDate),_normalizeDates30 = _slicedToArray(_normalizeDates29, 3),laterDate_ = _normalizeDates30[0],workingLaterDate = _normalizeDates30[1],earlierDate_ = _normalizeDates30[2];
var sign = _compareAsc(workingLaterDate, earlierDate_);
var difference = Math.abs(_differenceInCalendarMonths(workingLaterDate, earlierDate_));
if (difference < 1)
return 0;
if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
workingLaterDate