@fr0st/datetime 8.0.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"names":["data","Map","getData","key","callback","has","set","get","makeFormatter","locale","options","Intl","DateTimeFormat","timeZone","calendar","resolvedOptions","config","clampDates","defaultLocale","defaultTimeZone","dateStringTimeZoneRegExp","formats","formatTokenRegExp","monthDays","offsetRegExp","parseOrderKeys","diffMethods","year","month","week","day","hour","minute","second","thresholds","calendarDay","date","calendarDate","Date","setUTCFullYear","getYear","getMonth","getDate","getTime","calculateDiff","other","timeUnit","relative","withTimeZone","getTimeZone","compensateDiff","withYear","dateWeek","startOfWeek","otherWeek","withLocale","getLocale","withWeekYear","getWeekYear","getWeek","withHours","getHours","getMinutes","getSeconds","Error","valuesRegExp","values","slice","sort","a","b","length","map","value","replace","escapeRegExp","join","amount","compensate","compensation","Math","floor","ceil","getOffsetTime","getTimeZoneOffset","parseCompare","formatString","dateString","i","char","setOffsetTime","time","direction","newDate","withTime","newOffsetTime","adjustedDate","adjustedOffsetTime","getDayPeriods","type","dayPeriodFormatter","hourCycle","Array","fill","_","index","formatToParts","UTC","find","part","getDays","standalone","dayFormatter","weekday","format","getEras","eraFormatter","era","getMonths","monthFormatter","getNumbers","numberFormatter","numberRegExp","quantifier","formatDay","formatMonth","formatNumber","number","padding","numbers","padStart","match","formatOffset","offset","useColon","optionalMinutes","includeSeconds","absoluteSeconds","abs","totalSeconds","round","precision","Number","EPSILON","max","roundingError","isFinite","hours","minutes","seconds","sign","parts","push","formatRelative","unit","relativeFormatter","RelativeTimeFormat","numeric","style","getRelativeFormatter","weekStart","minDaysInFirstWeek","generatedValue","candidates","fallback","candidate","valueLocales","Object","entries","includes","parseInt","getWeekInfo","localeData","Locale","runtimeInfo","weekInfo","firstDay","minimalDays","regionOverride","toString","split","region","language","script","filter","toLowerCase","localeCandidates","phpFirstDay","decodeLiteral","literal","getType","getTokenRegExp","source","nextSource","previousNumeric","numberSource","minimumDays","weekDay","parseDay","indexOf","parseMonth","parseNumberString","from","digit","parseNumber","tokens","G","regex","input","parseEra","output","datetime","y","Y","Q","supportsLength","getQuarter","q","M","parsing","L","w","W","getWeekOfMonth","d","D","getDayOfYear","F","getWeekDayInMonth","E","getDay","e","getWeekDay","c","parseDayPeriod","dayPeriod","h","H","K","k","m","s","S","padEnd","milliseconds","getMilliseconds","z","min","timeZoneName","Z","prefix","O","V","X","x","DateTime","clearDataCache","clear","dayOfYear","reduce","this","daysInMonth","getUTCMonth","isLeapYear","getUTCFullYear","daysInYear","fromArray","dateArray","dateValues","timeValues","withTimestamp","fromDate","fromFormat","requestedTimeZone","previousTokenNumeric","token","position","substring","repeat","nextToken","nextLength","matchedValue","RegExp","methods","isPM","lastAM","withDate","withDayOfYear","hours12","hours24","withMilliseconds","withMinutes","withMonth","quarter","withQuarter","withSeconds","withWeek","withWeekDay","weekDayInMonth","withWeekDayInMonth","weekOfMonth","withWeekOfMonth","weekYear","parseFactory","testValues","subKeys","subKey","isValid","fromISOString","fromTimestamp","timestamp","getDefaultLocale","getDefaultTimeZone","getUTCDate","now","setDateClamping","setDefaultLocale","setDefaultTimeZone","constructor","adjustOffset","parse","isNaN","test","localTimestamp","fraction","setUTCHours","parseLocalTimestamp","getTimezoneOffset","_date","_dynamicTz","_offset","_timeZone","_locale","fromEntries","fractionalSecondDigits","getDateFormatter","localDate","localTime","fractionalSecond","getOffset","resolvedDate","setTime","addDay","addDays","setUTCDate","addHour","addHours","addMinute","addMinutes","addMonth","addMonths","addSecond","addSeconds","addWeek","addWeeks","addYear","addYears","dayName","period","formatDayPeriod","diff","diffInDays","diffInHours","diffInMinutes","diffInMonths","diffInSeconds","diffInWeeks","diffInYears","endOfDay","endOfHour","endOfMinute","endOfMonth","endOfQuarter","endOfSecond","endOfWeek","endOfYear","formatEra","getUTCDay","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCSeconds","getTimestamp","thisWeek","startOfDay","firstWeek","first","minDays","humanDiff","lastResult","diffMethod","relativeDiff","getBiggestDiff","humanDiffInDays","humanDiffInHours","humanDiffInMinutes","humanDiffInMonths","humanDiffInSeconds","humanDiffInWeeks","humanDiffInYears","isAfter","isAfterDay","isAfterHour","isAfterMinute","isAfterMonth","isAfterSecond","isAfterWeek","isAfterYear","isBefore","isBeforeDay","isBeforeHour","isBeforeMinute","isBeforeMonth","isBeforeSecond","isBeforeWeek","isBeforeYear","isBetween","start","end","isBetweenDay","isBetweenHour","isBetweenMinute","isBetweenMonth","isBetweenSecond","isBetweenWeek","isBetweenYear","isDst","dateA","dateB","isSame","isSameDay","isSameHour","isSameMinute","isSameMonth","isSameOrAfter","isSameOrAfterDay","isSameOrAfterHour","isSameOrAfterMinute","isSameOrAfterMonth","isSameOrAfterSecond","isSameOrAfterWeek","isSameOrAfterYear","isSameOrBefore","isSameOrBeforeDay","isSameOrBeforeHour","isSameOrBeforeMinute","isSameOrBeforeMonth","isSameOrBeforeSecond","isSameOrBeforeWeek","isSameOrBeforeYear","isSameSecond","isSameWeek","isSameYear","monthName","startOfHour","startOfMinute","startOfMonth","startOfQuarter","startOfSecond","startOfYear","subDay","subDays","subHour","subHours","subMinute","subMinutes","subMonth","subMonths","subSecond","subSeconds","subWeek","subWeeks","subYear","subYears","Symbol","toPrimitive","hint","valueOf","formatTimeZoneName","toDateString","toIsoString","toJSON","toTimeString","toUTCString","weeksInYear","withDay","setUTCMonth","args","setUTCMilliseconds","setUTCMinutes","setUTCSeconds","withTimeZoneOffset","Constructor"],"sources":["../src/factory.js","../src/vars.js","../src/helpers.js","../src/formatter/values.js","../src/formatter/format.js","../src/formatter/locales.js","../src/formatter/locale.js","../src/formatter/utility.js","../src/formatter/parse.js","../src/formatter/tokens.js","../src/date-time.js"],"sourcesContent":["/**\n * DateTime Factory\n */\n\nconst data = new Map();\n\n/**\n * Clears all cached formatter and locale values.\n */\nexport function clearDataCache() {\n data.clear();\n};\n\n/**\n * Gets a cached value, creating it on first access.\n * @template T\n * @param {string} key The key for the values.\n * @param {() => T} callback The callback to generate the values.\n * @return {T} The cached value.\n */\nexport function getData(key, callback) {\n if (!data.has(key)) {\n data.set(key, callback());\n }\n\n return data.get(key);\n};\n\n/**\n * Creates a date formatter for a time zone.\n * @param {string} timeZone The time zone.\n * @return {Intl.DateTimeFormat} The formatter instance.\n */\nexport function getDateFormatter(timeZone) {\n return getData(\n `dateFormatter.${timeZone}`,\n () => makeFormatter('en', {\n timeZone,\n hourCycle: 'h23',\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n }),\n );\n};\n\n/**\n * Creates a relative-time formatter for a locale.\n * @param {string} locale The locale.\n * @return {Intl.RelativeTimeFormat|null} The formatter instance, or null when unsupported.\n */\nexport function getRelativeFormatter(locale) {\n if (!('RelativeTimeFormat' in Intl)) {\n return null;\n }\n\n return getData(\n `relativeFormatter.${locale}`,\n () => new Intl.RelativeTimeFormat(locale, {\n numeric: 'auto',\n style: 'long',\n }),\n );\n};\n\n/**\n * Creates a formatter for a locale.\n * @param {string} locale The locale.\n * @param {Intl.DateTimeFormatOptions} options The options for the formatter.\n * @return {Intl.DateTimeFormat} The formatter instance.\n */\nexport function makeFormatter(locale, options) {\n return new Intl.DateTimeFormat(locale, {\n timeZone: 'UTC',\n ...options,\n calendar: 'gregory',\n });\n};\n","/**\n * DateTime Variables\n */\n\nconst resolvedOptions = new Intl.DateTimeFormat().resolvedOptions();\n\nexport const config = {\n clampDates: true,\n defaultLocale: resolvedOptions.locale,\n defaultTimeZone: resolvedOptions.timeZone,\n};\n\nexport const dateStringTimeZoneRegExp = /(?:\\b(?:UTC|GMT)\\b|[T\\s]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{3})?)?(?:Z|[+-]\\d{2}(?::?\\d{2})?)\\b)/i;\n\nexport const formats = {\n date: 'eee MMM dd yyyy',\n rfc3339_extended: `yyyy-MM-dd'T'HH:mm:ss.SSSxxx`,\n string: 'eee MMM dd yyyy HH:mm:ss xx (VV)',\n time: 'HH:mm:ss xx (VV)',\n};\n\nexport const formatTokenRegExp = /([a-z])\\1*|''|'(?:[^']|'')*'/i;\n\nexport const monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nexport const offsetRegExp = /^(?:GMT)?([+-])([01]\\d|2[0-3])(?:(:?)([0-5]\\d)(?:\\3([0-5]\\d))?)?$/;\n\nexport const parseOrderKeys = [\n ['year', 'weekYear'],\n ['era'],\n ['quarter', 'month', 'week', 'dayOfYear'],\n ['weekOfMonth'],\n ['date', 'weekDay'],\n ['weekDayInMonth'],\n ['hours24', 'hours12', 'dayPeriod'],\n ['minutes', 'seconds', 'milliseconds'],\n];\n\nexport const diffMethods = {\n year: 'diffInYears',\n month: 'diffInMonths',\n week: 'diffInWeeks',\n day: 'diffInDays',\n hour: 'diffInHours',\n minute: 'diffInMinutes',\n second: 'diffInSeconds',\n};\n\nexport const thresholds = {\n month: 12,\n week: null,\n day: 7,\n hour: 24,\n minute: 60,\n second: 60,\n};\n","import { getDateFormatter } from './factory.js';\nimport { diffMethods, thresholds } from './vars.js';\n\n/** @typedef {import('./date-time.js').default} DateTime */\n\n/**\n * DateTime Helpers\n */\n\n/**\n * Escapes a string for safe use inside a RegExp source.\n * @param {string} value The string to escape.\n * @return {string} The escaped string.\n */\nfunction escapeRegExp(value) {\n return value.replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&');\n}\n\n/**\n * Gets a stable day number from a DateTime's local calendar fields.\n * @param {DateTime} date The DateTime.\n * @return {number} The local calendar day number.\n */\nfunction calendarDay(date) {\n const calendarDate = new Date(0);\n calendarDate.setUTCFullYear(date.getYear(), date.getMonth() - 1, date.getDate());\n\n return calendarDate.getTime() / 86400000;\n}\n\n/**\n * Calculates the difference between two dates in a given time unit.\n * @param {DateTime} date The base DateTime.\n * @param {DateTime} other The DateTime to compare to.\n * @param {'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second'} timeUnit The time unit to compare in.\n * @param {boolean} [relative=true] Whether to use relative boundaries when calculating the difference.\n * @return {number} The difference between the dates in the given time unit.\n */\nexport function calculateDiff(date, other, timeUnit, relative = true) {\n other = other.withTimeZone(date.getTimeZone());\n\n switch (timeUnit) {\n case 'year':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n ),\n date.getYear() - other.getYear(),\n !relative,\n -1,\n );\n case 'month':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n ),\n (date.getYear() - other.getYear()) * 12 + date.getMonth() - other.getMonth(),\n !relative,\n -1,\n );\n case 'week':\n if (relative) {\n const dateWeek = date.startOfWeek();\n const otherWeek = other.withLocale(date.getLocale()).startOfWeek();\n\n return (\n calendarDay(dateWeek) -\n calendarDay(otherWeek)\n ) / 7;\n }\n\n return compensateDiff(\n date,\n other.withWeekYear(\n date.getWeekYear(),\n date.getWeek(),\n ),\n (date - other) / 604800000,\n relative,\n );\n case 'day':\n if (relative) {\n return calendarDay(date) - calendarDay(other);\n }\n\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ),\n (date - other) / 86400000,\n relative,\n );\n case 'hour':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ).withHours(\n date.getHours(),\n ),\n (date - other) / 3600000,\n relative,\n );\n case 'minute':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ).withHours(\n date.getHours(),\n date.getMinutes(),\n ),\n (date - other) / 60000,\n relative,\n );\n case 'second':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ).withHours(\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ),\n (date - other) / 1000,\n relative,\n );\n default:\n throw new Error('Invalid time unit supplied');\n }\n};\n\n/**\n * Gets the RegExp for a list of string values.\n * Longer values are matched first to avoid prefix collisions.\n * @param {string[]} values The values to include in the RegExp.\n * @return {string} The values RegExp.\n */\nexport function valuesRegExp(values) {\n return values.slice()\n .sort((a, b) => b.length - a.length)\n .map((value) => escapeRegExp(`${value}`))\n .join('|');\n};\n\n/**\n * Compensates the difference between two dates.\n * @param {DateTime} date The DateTime.\n * @param {DateTime} other The DateTime to compare to.\n * @param {number} amount The amount to compensate.\n * @param {boolean} [compensate=true] Whether to compensate the amount.\n * @param {number} [compensation=1] The compensation offset.\n * @return {number} The compensated amount.\n */\nfunction compensateDiff(date, other, amount, compensate = true, compensation = 1) {\n if (amount > 0) {\n amount = Math.floor(amount);\n\n if (compensate && date < other) {\n amount += compensation;\n }\n } else if (amount < 0) {\n amount = Math.ceil(amount);\n\n if (compensate && date > other) {\n amount -= compensation;\n }\n }\n\n return amount;\n};\n\n/**\n * Gets the biggest difference between two dates.\n * @param {DateTime} date The DateTime.\n * @param {DateTime} [other] The DateTime to compare to.\n * @return {[number, string]} The biggest difference (amount and time unit).\n */\nexport function getBiggestDiff(date, other) {\n let lastResult;\n for (const [timeUnit, diffMethod] of Object.entries(diffMethods)) {\n const relativeDiff = date[diffMethod](other);\n\n if (lastResult && thresholds[timeUnit] && Math.abs(relativeDiff) >= thresholds[timeUnit]) {\n return lastResult;\n }\n\n const actualDiff = date[diffMethod](other, { relative: false });\n\n if (actualDiff) {\n return [relativeDiff, timeUnit];\n }\n\n if (relativeDiff) {\n lastResult = [relativeDiff, timeUnit];\n } else {\n lastResult = null;\n }\n }\n\n return lastResult ?\n lastResult :\n [0, 'second'];\n};\n\n/**\n * Gets the offset for a DateTime.\n * @param {DateTime} date The DateTime.\n * @return {number} The offset.\n */\nexport function getOffset(date) {\n const timeZone = date.getTimeZone();\n\n if (timeZone === 'UTC') {\n return 0;\n }\n\n const values = Object.fromEntries(\n getDateFormatter(timeZone)\n .formatToParts(date)\n .filter((part) => part.type !== 'literal')\n .map(({ type, value }) => [type, value]),\n );\n\n let year = parseInt(values.year, 10);\n if (values.era === 'BC') {\n year = 1 - year;\n }\n\n const localDate = new Date(0);\n localDate.setUTCFullYear(\n year,\n parseInt(values.month, 10) - 1,\n parseInt(values.day, 10),\n );\n const localTime = localDate.setUTCHours(\n parseInt(values.hour, 10),\n parseInt(values.minute, 10),\n parseInt(values.second, 10),\n parseInt(values.fractionalSecond, 10),\n );\n\n return (date.getTime() - localTime) / 60000;\n};\n\n/**\n * Gets the number of milliseconds since the UNIX epoch (offset to timeZone).\n * @param {DateTime} date The DateTime.\n * @return {number} The number of milliseconds since the UNIX epoch (offset to timeZone).\n */\nexport function getOffsetTime(date) {\n return date.getTime() - (date.getTimeZoneOffset() * 60000);\n};\n\n/**\n * Compares a literal format string with a date string.\n * @param {string} formatString The literal format string.\n * @param {string} dateString The date string.\n */\nexport function parseCompare(formatString, dateString) {\n let i = 0;\n for (const char of formatString) {\n if (char !== dateString[i]) {\n throw new Error(`Unmatched character in DateTime string: ${char}`);\n }\n\n i++;\n }\n};\n\n/**\n * Parses a supported unzoned ISO string as a neutral wall-clock timestamp.\n * @param {string} dateString The date string to parse.\n * @return {number|null} The timestamp, or null if the shape is not supported.\n */\nexport function parseLocalTimestamp(dateString) {\n const match =\n dateString.match(/^(\\d{4})(?:-(\\d{2})(?:-(\\d{2}))?)?$/) ||\n dateString.match(/^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?$/);\n\n if (!match) {\n return null;\n }\n\n const [\n , year,\n month = 1,\n day = 1,\n hours = 0,\n minutes = 0,\n seconds = 0,\n fraction = '',\n ] = match;\n const date = new Date(0);\n\n date.setUTCFullYear(year, month - 1, day);\n date.setUTCHours(hours, minutes, seconds, fraction.padEnd(3, '0').substring(0, 3));\n\n return date.getTime();\n};\n\n/**\n * Generates methods for parsing a date.\n * @return {Record<string, {get: Function, set: Function}>} An object containing date parsing methods.\n */\nexport function parseFactory() {\n let isPM = false;\n let lastAM = true;\n\n return {\n date: {\n get: (datetime) => datetime.getDate(),\n set: (datetime, value) => datetime.withDate(value),\n },\n dayPeriod: {\n get: (datetime) => datetime.getHours() < 12 ? 0 : 1,\n set: (datetime, value) => {\n isPM = value;\n let hours = value ? 12 : 0;\n if (lastAM) {\n hours += datetime.getHours();\n }\n return datetime.withHours(hours);\n },\n },\n dayOfYear: {\n get: (datetime) => datetime.getDayOfYear(),\n set: (datetime, value) => datetime.withDayOfYear(value),\n },\n era: {\n get: (datetime) => datetime.getYear() < 0 ? 0 : 1,\n set: (datetime, value) => {\n const offset = value ? 1 : -1;\n return datetime.withYear(\n datetime.getYear() * offset,\n );\n },\n },\n hours12: {\n get: (datetime) => datetime.getHours() % 12,\n set: (datetime, value) => {\n if (isPM) {\n value += 12;\n }\n lastAM = true;\n return datetime.withHours(value);\n },\n },\n hours24: {\n get: (datetime) => datetime.getHours(),\n set: (datetime, value) => {\n lastAM = false;\n return datetime.withHours(value);\n },\n },\n milliseconds: {\n get: (datetime) => datetime.getMilliseconds(),\n set: (datetime, value) => datetime.withMilliseconds(value),\n },\n minutes: {\n get: (datetime) => datetime.getMinutes(),\n set: (datetime, value) => datetime.withMinutes(value),\n },\n month: {\n get: (datetime) => datetime.getMonth(),\n set: (datetime, value) => datetime.withMonth(value),\n },\n quarter: {\n get: (datetime) => datetime.getQuarter(),\n set: (datetime, value) => datetime.withQuarter(value),\n },\n seconds: {\n get: (datetime) => datetime.getSeconds(),\n set: (datetime, value) => datetime.withSeconds(value),\n },\n week: {\n get: (datetime) => datetime.getWeek(),\n set: (datetime, value) => datetime.withWeek(value),\n },\n weekDay: {\n get: (datetime) => datetime.getWeekDay(),\n set: (datetime, value) => datetime.withWeekDay(value),\n },\n weekDayInMonth: {\n get: (datetime) => datetime.getWeekDayInMonth(),\n set: (datetime, value) => datetime.withWeekDayInMonth(value),\n },\n weekOfMonth: {\n get: (datetime) => datetime.getWeekOfMonth(),\n set: (datetime, value) => datetime.withWeekOfMonth(value),\n },\n weekYear: {\n get: (datetime) => datetime.getWeekYear(),\n set: (datetime, value) => datetime.withWeekYear(value),\n },\n year: {\n get: (datetime) => {\n const year = datetime.getYear();\n return Math.abs(year);\n },\n set: (datetime, value) => datetime.withYear(value),\n },\n };\n};\n\n/**\n * Sets the number of milliseconds since the UNIX epoch (offset to timeZone).\n * @param {DateTime} date The DateTime.\n * @param {number} time The number of milliseconds since the UNIX epoch (offset to timeZone).\n * @param {number} [direction=1] The direction to resolve a gap.\n * @return {DateTime} A new DateTime instance.\n */\nexport function setOffsetTime(date, time, direction = 1) {\n const newDate = date.withTime(\n time + (date.getTimeZoneOffset() * 60000),\n );\n const newOffsetTime = getOffsetTime(newDate);\n\n if (newOffsetTime === time) {\n return newDate;\n }\n\n const adjustedDate = date.withTime(\n time + (newDate.getTimeZoneOffset() * 60000),\n );\n const adjustedOffsetTime = getOffsetTime(adjustedDate);\n\n if (adjustedOffsetTime === time) {\n return adjustedDate;\n }\n\n if (direction < 0) {\n return newOffsetTime < adjustedOffsetTime ?\n newDate :\n adjustedDate;\n }\n\n return newOffsetTime > adjustedOffsetTime ?\n newDate :\n adjustedDate;\n};\n","import { getData, makeFormatter } from './../factory.js';\nimport { valuesRegExp } from './../helpers.js';\n\n/**\n * Formatter value caches.\n */\n\n/**\n * Gets cached localized day-period labels.\n * @param {string} locale The locale.\n * @param {string} [type=long] The formatting type.\n * @return {string[]} The localized day-period labels.\n */\nexport function getDayPeriods(locale, type = 'long') {\n return getData(\n `periods.${locale}.${type}`,\n () => {\n const dayPeriodFormatter = makeFormatter(locale, { hour: 'numeric', hourCycle: 'h11' });\n return new Array(2)\n .fill()\n .map((_, index) =>\n dayPeriodFormatter.formatToParts(Date.UTC(2018, 0, 1, index * 12))\n .find((part) => part.type === 'dayPeriod')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized weekday labels.\n * @param {string} locale The locale.\n * @param {string} [type=long] The formatting type.\n * @param {boolean} [standalone=true] Whether the values are standalone.\n * @return {string[]} The localized weekday labels.\n */\nexport function getDays(locale, type = 'long', standalone = true) {\n return getData(\n `days.${locale}.${type}.${standalone}`,\n () => {\n if (standalone) {\n const dayFormatter = makeFormatter(locale, { weekday: type });\n return new Array(7)\n .fill()\n .map((_, index) =>\n dayFormatter.format(Date.UTC(2018, 0, index)),\n );\n }\n\n const dayFormatter = makeFormatter(locale, { year: 'numeric', month: 'numeric', day: 'numeric', weekday: type });\n return new Array(7)\n .fill()\n .map((_, index) =>\n dayFormatter.formatToParts(Date.UTC(2018, 0, index))\n .find((part) => part.type === 'weekday')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized era labels.\n * @param {string} locale The locale.\n * @param {string} [type=long] The formatting type.\n * @return {string[]} The localized era labels.\n */\nexport function getEras(locale, type = 'long') {\n return getData(\n `eras.${locale}.${type}`,\n () => {\n const eraFormatter = makeFormatter(locale, { era: type });\n return new Array(2)\n .fill()\n .map((_, index) =>\n eraFormatter.formatToParts(Date.UTC(index - 1, 0, 1))\n .find((part) => part.type === 'era')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized month labels.\n * @param {string} locale The locale.\n * @param {string} [type=long] The formatting type.\n * @param {boolean} [standalone=true] Whether the values are standalone.\n * @return {string[]} The localized month labels.\n */\nexport function getMonths(locale, type = 'long', standalone = true) {\n return getData(\n `months.${locale}.${type}.${standalone}`,\n () => {\n if (standalone) {\n const monthFormatter = makeFormatter(locale, { month: type });\n return new Array(12)\n .fill()\n .map((_, index) =>\n monthFormatter.format(Date.UTC(2018, index, 1)),\n );\n }\n\n const monthFormatter = makeFormatter(locale, { year: 'numeric', month: type, day: 'numeric' });\n return new Array(12)\n .fill()\n .map((_, index) =>\n monthFormatter.formatToParts(Date.UTC(2018, index, 1))\n .find((part) => part.type === 'month')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized digit glyphs.\n * @param {string} locale The locale.\n * @return {string[]} The localized digit glyphs.\n */\nexport function getNumbers(locale) {\n return getData(\n `numbers.${locale}`,\n () => {\n const numberFormatter = makeFormatter(locale, { minute: 'numeric' });\n return new Array(10)\n .fill()\n .map((_, index) =>\n numberFormatter.format(Date.UTC(2018, 0, 1, 0, index)),\n );\n },\n );\n};\n\n/**\n * Gets the RegExp for the number values.\n * @param {string} locale The locale.\n * @param {number|null} [length=null] The exact number of digits to match.\n * @return {string} The number values RegExp.\n */\nexport function numberRegExp(locale, length = null) {\n const quantifier = length === null ?\n '+' :\n `{${length}}`;\n return `(?:${valuesRegExp(getNumbers(locale))})${quantifier}`;\n};\n","import { getRelativeFormatter, makeFormatter } from './../factory.js';\nimport { getDayPeriods, getDays, getEras, getMonths, getNumbers } from './values.js';\n\n/**\n * Formats a day as a locale string.\n * @param {string} locale The locale.\n * @param {number} day The day to format (0-6).\n * @param {string} [type=long] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @return {string} The formatted string.\n */\nexport function formatDay(locale, day, type = 'long', standalone = true) {\n return getDays(locale, type, standalone)[day];\n};\n\n/**\n * Formats a day period as a locale string.\n * @param {string} locale The locale.\n * @param {number} period The day-period index to format. (0-1)\n * @param {string} [type=long] The formatting type.\n * @return {string} The formatted string.\n */\nexport function formatDayPeriod(locale, period, type = 'long') {\n return getDayPeriods(locale, type)[period];\n};\n\n/**\n * Formats an era as a locale string.\n * @param {string} locale The locale.\n * @param {number} era The era index to format. (0-1)\n * @param {string} [type=long] The formatting type.\n * @return {string} The formatted string.\n */\nexport function formatEra(locale, era, type = 'long') {\n return getEras(locale, type)[era];\n};\n\n/**\n * Formats a month as a locale string.\n * @param {string} locale The locale.\n * @param {number} month The month to format (1-12).\n * @param {string} [type=long] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @return {string} The formatted string.\n */\nexport function formatMonth(locale, month, type = 'long', standalone = true) {\n return getMonths(locale, type, standalone)[month - 1];\n};\n\n/**\n * Formats a number as a locale number string.\n * @param {string} locale The locale.\n * @param {number} number The number to format.\n * @param {number} [padding=0] The amount of padding to use.\n * @return {string} The formatted string.\n */\nexport function formatNumber(locale, number, padding = 0) {\n const numbers = getNumbers(locale);\n return `${number}`\n .padStart(padding, '0')\n .replace(/\\d/g, (match) => numbers[match]);\n};\n\n/**\n * Formats a number to an offset string.\n * @param {number} offset The offset to format.\n * @param {boolean} [useColon=true] Whether to use a colon separator.\n * @param {boolean} [optionalMinutes=false] Whether minutes are optional.\n * @param {boolean} [includeSeconds=true] Whether seconds are included.\n * @return {string} The formatted offset string.\n */\nexport function formatOffset(offset, useColon = true, optionalMinutes = false, includeSeconds = true) {\n const absoluteSeconds = Math.abs(offset * 60);\n const totalSeconds = Math.round(absoluteSeconds);\n const precision = Number.EPSILON * Math.max(1, absoluteSeconds);\n const roundingError = Math.abs(absoluteSeconds - totalSeconds);\n if (!Number.isFinite(absoluteSeconds) || roundingError > precision || totalSeconds >= 86400) {\n throw new Error('Invalid time zone offset supplied');\n }\n\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor(totalSeconds % 3600 / 60);\n const seconds = totalSeconds % 60;\n const sign = offset > 0 ?\n '-' :\n '+';\n const parts = [`${hours}`.padStart(2, '0')];\n\n if (!optionalMinutes || minutes || seconds) {\n parts.push(`${minutes}`.padStart(2, '0'));\n }\n\n if (includeSeconds && seconds) {\n parts.push(`${seconds}`.padStart(2, '0'));\n }\n\n return sign + parts.join(useColon ? ':' : '');\n};\n\n/**\n * Formats a relative duration as a locale string.\n * @param {string} locale The locale.\n * @param {number} amount The amount of duration.\n * @param {string} unit The time unit.\n * @return {string} The relative duration.\n */\nexport function formatRelative(locale, amount, unit) {\n const relativeFormatter = getRelativeFormatter(locale);\n\n if (!relativeFormatter) {\n throw new Error('RelativeTimeFormat not supported');\n }\n\n return relativeFormatter.format(amount, unit);\n};\n\n/**\n * Formats a time zone as a locale string.\n * @param {string} locale The locale.\n * @param {number} timestamp The timestamp to use.\n * @param {string} timeZone The time zone to format.\n * @param {string} [type=long] The formatting type.\n * @return {string} The formatted string.\n */\nexport function formatTimeZoneName(locale, timestamp, timeZone, type = 'long') {\n return makeFormatter(locale, { second: 'numeric', timeZone, timeZoneName: type })\n .formatToParts(timestamp)\n .find((part) => part.type === 'timeZoneName')\n .value;\n};\n","export const weekStart = { '1': ['af', 'am', 'ar-il', 'ar-sa', 'ar-ye', 'as', 'bn', 'bo', 'brx', 'ccp', 'ceb', 'chr', 'dav', 'doi', 'dz', 'ebu', 'en', 'es-br', 'es-bz', 'es-co', 'es-do', 'es-gt', 'es-hn', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-ph', 'es-pr', 'es-py', 'es-sv', 'es-us', 'es-ve', 'fil', 'fr-ca', 'gu', 'guz', 'haw', 'he', 'hi', 'id', 'ii', 'ja', 'jv', 'kam', 'ki', 'kln', 'km', 'kn', 'ko', 'kok', 'ks', 'lkt', 'lo', 'luo', 'luy', 'mai', 'mas', 'mer', 'mgh', 'ml', 'mni', 'mr', 'ms-id', 'ms-sg', 'mt', 'my', 'nd', 'ne', 'om', 'or', 'pa', 'ps-pk', 'pt', 'qu', 'sa', 'saq', 'sat', 'sd', 'seh', 'sn', 'so-et', 'so-ke', 'su', 'sw-ke', 'ta', 'te', 'teo-ke', 'th', 'ti', 'ug', 'ur', 'xh', 'yue', 'zh', 'zu'], '2': ['af-na', 'ar-001', 'ar-eh', 'ar-er', 'ar-km', 'ar-lb', 'ar-ma', 'ar-mr', 'ar-ps', 'ar-so', 'ar-ss', 'ar-td', 'ar-tn', 'en-001', 'en-150', 'en-ai', 'en-at', 'en-au', 'en-bb', 'en-be', 'en-bi', 'en-bm', 'en-cc', 'en-ch', 'en-ck', 'en-cm', 'en-cx', 'en-cy', 'en-de', 'en-dg', 'en-dk', 'en-er', 'en-fi', 'en-fj', 'en-fk', 'en-fm', 'en-gb', 'en-gd', 'en-gg', 'en-gh', 'en-gi', 'en-gm', 'en-gy', 'en-ie', 'en-im', 'en-io', 'en-je', 'en-ki', 'en-kn', 'en-ky', 'en-lc', 'en-lr', 'en-ls', 'en-mg', 'en-mp', 'en-ms', 'en-mu', 'en-mw', 'en-my', 'en-na', 'en-nf', 'en-ng', 'en-nl', 'en-nr', 'en-nu', 'en-nz', 'en-pg', 'en-pn', 'en-pw', 'en-rw', 'en-sb', 'en-sc', 'en-se', 'en-sh', 'en-si', 'en-sl', 'en-ss', 'en-sx', 'en-sz', 'en-tc', 'en-tk', 'en-to', 'en-tv', 'en-tz', 'en-ug', 'en-vc', 'en-vg', 'en-vu', 'en-zm', 'ko-kp', 'mas-tz', 'pt-ao', 'pt-ch', 'pt-cv', 'pt-gq', 'pt-gw', 'pt-lu', 'pt-st', 'pt-tl', 'qu-bo', 'qu-ec', 'ta-lk', 'ta-my', 'ti-er'], '7': ['ar', 'ckb', 'en-ae', 'en-sd', 'fa', 'fr-dj', 'fr-dz', 'fr-sy', 'kab', 'lrc', 'mzn', 'ps', 'so-dj', 'uz-arab', 'uz-arab-af'] };\nexport const minDaysInFirstWeek = { '4': ['ast', 'bg', 'br', 'ca', 'ce', 'cs', 'cy', 'da', 'de', 'dsb', 'el', 'en-at', 'en-be', 'en-ch', 'en-de', 'en-dk', 'en-fi', 'en-fj', 'en-gb', 'en-gg', 'en-gi', 'en-ie', 'en-im', 'en-je', 'en-nl', 'en-se', 'es', 'et', 'eu', 'fi', 'fo', 'fr', 'fur', 'fy', 'ga', 'gd', 'gl', 'gsw', 'gv', 'hsb', 'hu', 'is', 'it', 'ksh', 'kw', 'lb', 'lt', 'nb', 'nl', 'nn', 'no', 'os-ru', 'pl', 'pt-ch', 'pt-lu', 'pt-pt', 'rm', 'ru', 'sah', 'sc', 'se', 'sk', 'smn', 'sv', 'tt', 'wae'], '1': ['da-gl', 'el-cy', 'es-419', 'es-ar', 'es-bo', 'es-br', 'es-bz', 'es-cl', 'es-co', 'es-cr', 'es-cu', 'es-do', 'es-ea', 'es-ec', 'es-gq', 'es-gt', 'es-hn', 'es-ic', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-ph', 'es-pr', 'es-py', 'es-sv', 'es-us', 'es-uy', 'es-ve', 'fr-bf', 'fr-bi', 'fr-bj', 'fr-bl', 'fr-ca', 'fr-cd', 'fr-cf', 'fr-cg', 'fr-ci', 'fr-cm', 'fr-dj', 'fr-dz', 'fr-ga', 'fr-gn', 'fr-gq', 'fr-ht', 'fr-km', 'fr-ma', 'fr-mf', 'fr-mg', 'fr-ml', 'fr-mr', 'fr-mu', 'fr-nc', 'fr-ne', 'fr-pf', 'fr-pm', 'fr-rw', 'fr-sc', 'fr-sn', 'fr-sy', 'fr-td', 'fr-tg', 'fr-tn', 'fr-vu', 'fr-wf', 'fr-yt', 'nl-aw', 'nl-bq', 'nl-cw', 'nl-sr', 'nl-sx', 'ru-by', 'ru-kg', 'ru-kz', 'ru-md', 'ru-ua'] };\n","import { getData } from './../factory.js';\nimport { minDaysInFirstWeek, weekStart } from './locales.js';\n\n/**\n * Gets a locale value from generated data.\n * @param {object} data The generated locale data.\n * @param {string[]} candidates The locale candidates.\n * @param {number} fallback The fallback value.\n * @return {number} The locale value.\n */\nfunction generatedValue(data, candidates, fallback) {\n for (const candidate of candidates) {\n for (const [value, valueLocales] of Object.entries(data)) {\n if (valueLocales.includes(candidate)) {\n return parseInt(value, 10);\n }\n }\n }\n\n return fallback;\n}\n\n/**\n * Gets generated-data candidates for a locale.\n * @param {Intl.Locale} locale The locale.\n * @return {string[]} The locale candidates.\n */\nfunction localeCandidates(locale) {\n const localeName = locale.toString().split('-x-', 1)[0];\n const regionOverride = localeName.match(\n /-u-(?:[a-z0-9]{2,8}-)*rg-([a-z]{2}|\\d{3})zzzz(?:-|$)/i,\n );\n const region = regionOverride?.[1] || locale.region;\n\n return [\n [locale.language, locale.script, region],\n [locale.language, region],\n [locale.language, locale.script],\n [locale.language],\n ].map((parts) =>\n parts\n .filter((part) => !!part)\n .join('-')\n .toLowerCase(),\n );\n}\n\n/**\n * Gets week information for a locale.\n * @param {string} locale The locale.\n * @return {{firstDay: number, minimalDays: number}} The week information.\n */\nexport function getWeekInfo(locale) {\n return getData(\n `weekInfo.${locale}`,\n () => {\n const localeData = new Intl.Locale(locale);\n const runtimeInfo = localeData.getWeekInfo?.() || localeData.weekInfo || {};\n\n let { firstDay = null, minimalDays = null } = runtimeInfo;\n\n const candidates = firstDay && minimalDays ?\n [] :\n localeCandidates(localeData);\n\n if (!firstDay) {\n const phpFirstDay = generatedValue(weekStart, candidates, 2);\n\n // IntlCalendar numbers Sunday as 1; Intl.Locale numbers it as 7.\n firstDay = phpFirstDay === 1 ? 7 : phpFirstDay - 1;\n }\n\n if (!minimalDays) {\n minimalDays = generatedValue(minDaysInFirstWeek, candidates, 1);\n }\n\n return { firstDay, minimalDays };\n },\n );\n};\n","import { getWeekInfo } from './locale.js';\nimport { numberRegExp } from './values.js';\n\n/**\n * Decodes a quoted ICU format literal.\n * @param {string} literal The literal to decode.\n * @return {string} The decoded literal.\n */\nexport function decodeLiteral(literal) {\n return literal === `''` ?\n `'` :\n literal.slice(1, -1).replace(/''/g, `'`);\n};\n\n/**\n * Gets the formatting type from the component token length.\n * @param {number} length The component token length.\n * @return {string} The formatting type.\n */\nexport function getType(length) {\n switch (length) {\n case 5:\n return 'narrow';\n case 4:\n return 'long';\n default:\n return 'short';\n }\n};\n\n/**\n * Gets the parsing RegExp data for a format token.\n * @param {string} source The token RegExp.\n * @param {string|null} nextSource The next token RegExp.\n * @param {number} length The token length.\n * @param {string} locale The parsing locale.\n * @param {boolean} previousNumeric Whether the previous token was an adjacent numeric token.\n * @return {{numeric: boolean, source: string}} The token RegExp data.\n */\nexport function getTokenRegExp(source, nextSource, length, locale, previousNumeric) {\n const numberSource = numberRegExp(locale);\n let numeric = true;\n\n if (source !== numberSource) {\n numeric = false;\n } else if (previousNumeric || nextSource === numberSource) {\n source = numberRegExp(locale, length);\n }\n\n return { numeric, source };\n};\n\n/**\n * Gets the locale's minimum days in the first week of the year.\n * @param {string} locale The locale.\n * @return {number} The minimum day count.\n */\nexport function minimumDays(locale) {\n return getWeekInfo(locale).minimalDays;\n};\n\n/**\n * Converts a Sunday-based day-of-week value to the locale's week numbering.\n * @param {string} locale The locale.\n * @param {number} day The day of the week. (0 = Sunday, 6 = Saturday)\n * @return {number} The local day of the week.\n */\nexport function weekDay(locale, day) {\n return (7 + parseInt(day, 10) - (getWeekInfo(locale).firstDay % 7)) % 7 + 1;\n};\n","import { weekDay } from './utility.js';\nimport { getDayPeriods, getDays, getEras, getMonths, getNumbers } from './values.js';\n\n/**\n * Parses a day from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type=long] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @return {number} The local day of the week (1-7).\n */\nexport function parseDay(locale, value, type = 'long', standalone = true) {\n const day = getDays(locale, type, standalone).indexOf(value);\n if (day === -1) {\n throw new Error(`Unmatched day string in DateTime string: ${value}`);\n }\n return weekDay(locale, day);\n};\n\n/**\n * Parses a day period from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type=long] The formatting type.\n * @return {number} The day period (0-1).\n */\nexport function parseDayPeriod(locale, value, type = 'long') {\n return getDayPeriods(locale, type).indexOf(value);\n};\n\n/**\n * Parses an era from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type=long] The formatting type.\n * @return {number} The era (0-1).\n */\nexport function parseEra(locale, value, type = 'long') {\n return getEras(locale, type).indexOf(value);\n};\n\n/**\n * Parses a month from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type=long] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @return {number} The month number (1-12).\n */\nexport function parseMonth(locale, value, type = 'long', standalone = true) {\n return getMonths(locale, type, standalone).indexOf(value) + 1;\n};\n\n/**\n * Parses locale digits into an ASCII digit string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @return {string} The parsed ASCII digit string.\n */\nexport function parseNumberString(locale, value) {\n const numbers = getNumbers(locale);\n return Array.from(value, (digit) => numbers.indexOf(digit)).join('');\n};\n\n/**\n * Parses a number from a locale number string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @return {number} The parsed number.\n */\nexport function parseNumber(locale, value) {\n return parseInt(\n parseNumberString(locale, value),\n 10,\n );\n};\n","import { valuesRegExp } from './../helpers.js';\nimport { formatDay, formatMonth, formatNumber, formatOffset } from './format.js';\nimport { parseDay, parseDayPeriod, parseEra, parseMonth, parseNumber, parseNumberString } from './parse.js';\nimport { getType } from './utility.js';\nimport { getDayPeriods, getDays, getEras, getMonths, numberRegExp } from './values.js';\n\n/**\n * DateFormatter Format Data\n */\n\nexport default {\n\n /* ERA */\n\n G: {\n key: 'era',\n regex: (locale, length) => {\n const type = getType(length);\n return valuesRegExp(getEras(locale, type));\n },\n input: (locale, value, length) => {\n const type = getType(length);\n return parseEra(locale, value, type);\n },\n output: (datetime, length) => {\n const type = getType(length);\n return datetime.era(type);\n },\n },\n\n /* YEAR */\n\n // year\n y: {\n key: 'year',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value, length) => {\n value = parseNumber(locale, value);\n\n if (length !== 2 || `${value}`.length !== 2) {\n return value;\n }\n\n return value > 40 ?\n 1900 + value :\n 2000 + value;\n },\n output: (datetime, length) => {\n let year = datetime.getYear();\n if (length === 2) {\n year = `${year}`.slice(-2);\n }\n return formatNumber(\n datetime.getLocale(),\n Math.abs(year),\n length,\n );\n },\n },\n\n // week year\n Y: {\n key: 'weekYear',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value, length) => {\n value = parseNumber(locale, value);\n\n if (length !== 2 || `${value}`.length !== 2) {\n return value;\n }\n\n return value > 40 ?\n 1900 + value :\n 2000 + value;\n },\n output: (datetime, length) => {\n let year = datetime.getWeekYear();\n if (length === 2) {\n year = `${year}`.slice(-2);\n }\n return formatNumber(\n datetime.getLocale(),\n Math.abs(year),\n length,\n );\n },\n },\n\n /* QUARTER */\n\n // quarter\n Q: {\n key: 'quarter',\n supportsLength: (length) => length !== 3 && length !== 4,\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getQuarter(),\n length < 3 ? length : 0,\n ),\n },\n\n // quarter (standalone)\n q: {\n key: 'quarter',\n supportsLength: (length) => length !== 3 && length !== 4,\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getQuarter(),\n length < 3 ? length : 0,\n ),\n },\n\n /* MONTH */\n\n // month\n M: {\n key: 'month',\n supportsLength: (length, parsing) => !parsing || length !== 5,\n regex: (locale, length) => {\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return valuesRegExp(getMonths(locale, type, false));\n }\n default:\n return numberRegExp(locale);\n }\n },\n input: (locale, value, length) => {\n switch (length) {\n case 4:\n case 3: {\n const type = getType(length);\n return parseMonth(locale, value, type, false);\n }\n default:\n return parseNumber(locale, value);\n }\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n const month = datetime.getMonth();\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return formatMonth(locale, month, type, false);\n }\n default:\n return formatNumber(locale, month, length);\n }\n },\n },\n\n // month (standalone)\n L: {\n key: 'month',\n supportsLength: (length, parsing) => !parsing || length !== 5,\n regex: (locale, length) => {\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return valuesRegExp(getMonths(locale, type));\n }\n default:\n return numberRegExp(locale);\n }\n },\n input: (locale, value, length) => {\n switch (length) {\n case 4:\n case 3: {\n const type = getType(length);\n return parseMonth(locale, value, type);\n }\n default:\n return parseNumber(locale, value);\n }\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n const month = datetime.getMonth();\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return formatMonth(locale, month, type);\n }\n default:\n return formatNumber(locale, month, length);\n }\n },\n },\n\n /* WEEK */\n\n // local week\n w: {\n key: 'week',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getWeek(),\n length,\n ),\n },\n\n // local week of month\n W: {\n key: 'weekOfMonth',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getWeekOfMonth(),\n length,\n ),\n },\n\n /* DAY */\n\n // day of month\n d: {\n key: 'date',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getDate(),\n length,\n ),\n },\n\n // day of year\n D: {\n key: 'dayOfYear',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getDayOfYear(),\n length,\n ),\n },\n\n // day of week in month\n F: {\n key: 'weekDayInMonth',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getWeekDayInMonth(),\n length,\n ),\n },\n\n // week day name\n E: {\n key: 'weekDay',\n supportsLength: (length, parsing) =>\n length !== 6 && (!parsing || length !== 5),\n regex: (locale, length) => {\n const type = getType(length);\n return valuesRegExp(getDays(locale, type, false));\n },\n input: (locale, value, length) => {\n const type = getType(length);\n return parseDay(locale, value, type, false);\n },\n output: (datetime, length) => {\n const type = getType(length);\n const locale = datetime.getLocale();\n const day = datetime.getDay();\n return formatDay(locale, day, type, false);\n },\n },\n\n // week day\n e: {\n key: 'weekDay',\n supportsLength: (length, parsing) =>\n length !== 6 && (!parsing || length !== 5),\n regex: (locale, length) => {\n if (length < 3) {\n return numberRegExp(locale);\n }\n\n const type = getType(length);\n return valuesRegExp(getDays(locale, type, false));\n },\n input: (locale, value, length) => {\n if (length < 3) {\n return parseNumber(locale, value);\n }\n\n const type = getType(length);\n return parseDay(locale, value, type, false);\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n if (length < 3) {\n return formatNumber(locale, datetime.getWeekDay(), length);\n }\n\n const type = getType(length);\n return formatDay(locale, datetime.getDay(), type, false);\n },\n },\n\n // week day (standalone)\n c: {\n key: 'weekDay',\n supportsLength: (length, parsing) =>\n length !== 6 && (!parsing || length !== 5),\n regex: (locale, length) => {\n if (length < 3) {\n return numberRegExp(locale);\n }\n\n const type = getType(length);\n return valuesRegExp(getDays(locale, type));\n },\n input: (locale, value, length) => {\n if (length < 3) {\n return parseNumber(locale, value);\n }\n\n const type = getType(length);\n return parseDay(locale, value, type);\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n if (length < 3) {\n return formatNumber(locale, datetime.getWeekDay());\n }\n\n const type = getType(length);\n return formatDay(locale, datetime.getDay(), type);\n },\n },\n\n /* PERIOD */\n\n a: {\n key: 'dayPeriod',\n supportsLength: (length) => length <= 4,\n regex: (locale, length) => {\n const type = getType(length);\n return valuesRegExp(getDayPeriods(locale, type));\n },\n input: (locale, value, length) => {\n const type = getType(length);\n return parseDayPeriod(locale, value, type);\n },\n output: (datetime, length) => {\n const type = getType(length);\n return datetime.dayPeriod(type);\n },\n },\n\n /* HOUR */\n\n h: {\n key: 'hours12',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => {\n value = parseNumber(locale, value);\n if (value === 12) {\n value = 0;\n }\n return value;\n },\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours() % 12 || 12,\n length,\n ),\n },\n\n H: {\n key: 'hours24',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours(),\n length,\n ),\n },\n\n K: {\n key: 'hours12',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours() % 12,\n length,\n ),\n },\n\n k: {\n key: 'hours24',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => {\n value = parseNumber(locale, value);\n if (value === 24) {\n value = 0;\n }\n return value;\n },\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours() || 24,\n length,\n ),\n },\n\n /* MINUTE */\n\n m: {\n key: 'minutes',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getMinutes(),\n length,\n ),\n },\n\n /* SECOND */\n\n s: {\n key: 'seconds',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getSeconds(),\n length,\n ),\n },\n\n /* FRACTIONAL */\n\n S: {\n key: 'milliseconds',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) =>\n parseInt(\n parseNumberString(locale, value)\n .padEnd(3, '0')\n .slice(0, 3),\n 10,\n ),\n output: (datetime, length) => {\n const milliseconds = `${datetime.getMilliseconds()}`.padStart(3, '0');\n return formatNumber(\n datetime.getLocale(),\n milliseconds.padEnd(length, '0').slice(0, length),\n );\n },\n },\n\n /* TIMEZONE/OFFSET */\n\n z: {\n supportsLength: (_, parsing) => !parsing,\n output: (datetime, length) => {\n const type = getType(Math.min(length, 4));\n return datetime.timeZoneName(type);\n },\n },\n\n Z: {\n key: 'timeZone',\n regex: (_, length) => {\n if (length === 5) {\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}(?:\\\\:\\\\d{2})?|Z`;\n }\n\n return length >= 4 ?\n `GMT[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}|GMT` :\n `[\\\\+\\\\-]\\\\d{4}`;\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n const offset = datetime.getTimeZoneOffset();\n\n let useColon = true;\n let prefix = '';\n if (length === 5) {\n if (!offset) {\n return 'Z';\n }\n } else if (length >= 4) {\n prefix = 'GMT';\n\n if (!offset) {\n return prefix;\n }\n } else {\n useColon = false;\n }\n\n return prefix + formatOffset(offset, useColon, false, length === 5);\n },\n },\n\n O: {\n key: 'timeZone',\n supportsLength: (length) => length === 1 || length === 4,\n regex: (_, length) => {\n switch (length) {\n case 4:\n return `GMT[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}|GMT`;\n default:\n return `GMT[\\\\+\\\\-]\\\\d{2}|GMT`;\n }\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n const offset = datetime.getTimeZoneOffset();\n const prefix = 'GMT';\n\n if (!offset) {\n return prefix;\n }\n\n let optionalMinutes = false;\n switch (length) {\n case 4:\n break;\n default:\n optionalMinutes = true;\n }\n\n return prefix + formatOffset(offset, true, optionalMinutes);\n },\n },\n\n V: {\n key: 'timeZone',\n supportsLength: (length) => length === 2,\n regex: (_) => '([A-Za-z0-9_.+\\\\-/]+)',\n input: (_, value) => value,\n output: (datetime) => datetime.getTimeZone(),\n },\n\n X: {\n key: 'timeZone',\n supportsLength: (length) => length <= 5,\n regex: (_, length) => {\n switch (length) {\n case 5:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}(?:\\\\:\\\\d{2})?|Z`;\n case 4:\n return `[\\\\+\\\\-]\\\\d{4}(?:\\\\d{2})?|Z`;\n case 3:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}|Z`;\n case 2:\n return `[\\\\+\\\\-]\\\\d{4}|Z`;\n default:\n return `[\\\\+\\\\-]\\\\d{2}(?:\\\\d{2})?|Z`;\n }\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n const offset = datetime.getTimeZoneOffset();\n\n if (!offset) {\n return 'Z';\n }\n\n let useColon;\n switch (length) {\n case 5:\n case 3:\n useColon = true;\n break;\n default:\n useColon = false;\n break;\n }\n\n return formatOffset(offset, useColon, length === 1, length >= 4);\n },\n },\n\n x: {\n key: 'timeZone',\n supportsLength: (length) => length <= 5,\n regex: (_, length) => {\n switch (length) {\n case 5:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}(?:\\\\:\\\\d{2})?`;\n case 4:\n return `[\\\\+\\\\-]\\\\d{4}(?:\\\\d{2})?`;\n case 3:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}`;\n case 2:\n return `[\\\\+\\\\-]\\\\d{4}`;\n default:\n return `[\\\\+\\\\-]\\\\d{2}(?:\\\\d{2})?`;\n }\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n let useColon;\n switch (length) {\n case 5:\n case 3:\n useColon = true;\n break;\n default:\n useColon = false;\n break;\n }\n\n return formatOffset(datetime.getTimeZoneOffset(), useColon, length === 1, length >= 4);\n },\n },\n\n};\n","import { clearDataCache as clearFactoryDataCache } from './factory.js';\nimport {\n formatDay,\n formatDayPeriod,\n formatEra,\n formatMonth,\n formatOffset,\n formatRelative,\n formatTimeZoneName,\n} from './formatter/format.js';\nimport tokens from './formatter/tokens.js';\nimport { decodeLiteral, getTokenRegExp, minimumDays, weekDay } from './formatter/utility.js';\nimport {\n calculateDiff,\n getBiggestDiff,\n getOffset,\n getOffsetTime,\n parseCompare,\n parseFactory,\n parseLocalTimestamp,\n setOffsetTime,\n} from './helpers.js';\nimport {\n config,\n dateStringTimeZoneRegExp,\n formats,\n formatTokenRegExp,\n monthDays,\n offsetRegExp,\n parseOrderKeys,\n} from './vars.js';\n\n/**\n * @typedef {{timeZone?: string, locale?: string}} DateTimeOptions\n */\n\n/**\n * An immutable date and time object with locale-aware formatting and time-zone support.\n */\nexport default class DateTime {\n /**\n * Clears cached formatter and locale data.\n */\n static clearDataCache() {\n clearFactoryDataCache();\n }\n\n /**\n * Gets the day of the year for a year, month and date.\n * @param {number} year The year.\n * @param {number} month The month. (1-12)\n * @param {number} date The date.\n * @return {number} The day of the year. (1-366)\n */\n static dayOfYear(year, month, date) {\n return new Array(month - 1)\n .fill()\n .reduce(\n (d, _, i) =>\n d + this.daysInMonth(year, i + 1),\n date,\n );\n }\n\n /**\n * Gets the number of days in a month for a given year.\n * @param {number} year The year.\n * @param {number} month The month. (1-12)\n * @return {number} The number of days in the month.\n */\n static daysInMonth(year, month) {\n const date = new Date(0);\n date.setUTCFullYear(year, month - 1, 1);\n month = date.getUTCMonth();\n\n return monthDays[month] +\n (\n month === 1 && this.isLeapYear(\n date.getUTCFullYear(),\n ) ?\n 1 :\n 0\n );\n }\n\n /**\n * Gets the number of days in a given year.\n * @param {number} year The year.\n * @return {number} The number of days in the year.\n */\n static daysInYear(year) {\n return !this.isLeapYear(year) ?\n 365 :\n 366;\n }\n\n /**\n * Creates a new DateTime from an array. Missing month/date values default to 1.\n * Missing time values default to 0.\n * @param {number[]} dateArray The date to parse.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @return {DateTime} A new DateTime instance.\n */\n static fromArray(dateArray, options = {}) {\n const dateValues = dateArray.slice(0, 3);\n const timeValues = dateArray.slice(3);\n\n if (dateValues.length < 3) {\n dateValues.push(...new Array(3 - dateValues.length).fill(1));\n }\n\n if (timeValues.length < 4) {\n timeValues.push(...new Array(4 - timeValues.length).fill(0));\n }\n\n return new this(null, options)\n .withTimestamp(0)\n .withYear(...dateValues)\n .withHours(...timeValues);\n }\n\n /**\n * Creates a new DateTime from a Date.\n * @param {Date} date The date.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @return {DateTime} A new DateTime instance.\n */\n static fromDate(date, options = {}) {\n return new this(date.getTime(), options);\n }\n\n /**\n * Creates a new DateTime from a format string.\n * @param {string} formatString The format string.\n * @param {string} dateString The date string.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @throws {Error} Throws when the format contains unsupported parsing tokens such as\n * `MMMMM` or `LLLLL`.\n * @return {DateTime} A new DateTime instance.\n */\n static fromFormat(formatString, dateString, options = {}) {\n const locale = 'locale' in options ?\n options.locale :\n config.defaultLocale;\n const requestedTimeZone = 'timeZone' in options ?\n options.timeZone :\n config.defaultTimeZone;\n\n const values = [];\n\n let match;\n let previousTokenNumeric = false;\n while (formatString && (match = formatString.match(formatTokenRegExp))) {\n const token = match[1];\n const position = match.index;\n const length = match[0].length;\n\n if (position) {\n const formatTest = formatString.substring(0, position);\n parseCompare(formatTest, dateString);\n }\n\n formatString = formatString.substring(position + length);\n dateString = dateString.substring(position);\n\n if (!token) {\n const literal = decodeLiteral(match[0]);\n parseCompare(literal, dateString);\n dateString = dateString.substring(literal.length);\n previousTokenNumeric = false;\n continue;\n }\n\n if (!(token in tokens)) {\n throw new Error(`Invalid token in DateTime format: ${token}`);\n }\n\n if (tokens[token].supportsLength?.(length, true) === false) {\n throw new Error(`Unsupported parsing token in DateTime format: ${token.repeat(length)}`);\n }\n\n const previousNumeric = previousTokenNumeric && !position;\n let nextSource = null;\n\n if (!previousNumeric) {\n const nextToken = formatString[0];\n if (nextToken && nextToken in tokens) {\n const nextLength = formatString.match(/^(.)\\1*/)[0].length;\n nextSource = tokens[nextToken].regex(locale, nextLength);\n }\n }\n\n const { numeric, source } = getTokenRegExp(\n tokens[token].regex(locale, length),\n nextSource,\n length,\n locale,\n previousNumeric,\n );\n const matchedValue = dateString.match(new RegExp(`^${source}`));\n\n if (!matchedValue) {\n throw new Error(`Unmatched token in DateTime string: ${token}`);\n }\n\n const literal = matchedValue[0];\n const value = tokens[token].input(locale, literal, length);\n\n if (value !== null) {\n const key = tokens[token].key;\n values.push({ key, value, literal, token, length });\n }\n\n dateString = dateString.substring(literal.length);\n previousTokenNumeric = numeric;\n }\n\n if (formatString) {\n parseCompare(formatString, dateString);\n dateString = dateString.substring(formatString.length);\n }\n\n if (dateString) {\n throw new Error(`Unmatched trailing characters in DateTime string: ${dateString}`);\n }\n\n let timeZone = requestedTimeZone;\n for (const { key, value } of values) {\n if (key !== 'timeZone') {\n continue;\n }\n\n timeZone = value;\n }\n\n let datetime = this.fromArray([1970, 1, 1], {\n locale,\n timeZone,\n });\n\n const methods = parseFactory();\n\n const testValues = [];\n\n for (const subKeys of parseOrderKeys) {\n for (const subKey of subKeys) {\n if (subKey === 'era' && !values.find((data) => data.key === 'year')) {\n continue;\n }\n\n for (const data of values) {\n const { key, value } = data;\n\n if (key !== subKey) {\n continue;\n }\n\n datetime = methods[key].set(datetime, value);\n testValues.push(data);\n }\n }\n }\n\n let isValid = true;\n for (const { key, value } of testValues) {\n if (key in methods && methods[key].get(datetime) !== value) {\n isValid = false;\n break;\n }\n }\n\n if (requestedTimeZone !== timeZone) {\n datetime = datetime.withTimeZone(requestedTimeZone);\n }\n\n datetime.isValid = isValid;\n\n return datetime;\n }\n\n /**\n * Creates a new DateTime from an ISO format string.\n * @param {string} dateString The date string.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @return {DateTime} A new DateTime instance.\n */\n static fromISOString(dateString, options = {}) {\n let date = this.fromFormat(formats.rfc3339_extended, dateString, {\n locale: 'en',\n });\n\n if ('timeZone' in options) {\n date = date.withTimeZone(options.timeZone);\n }\n\n if ('locale' in options) {\n date = date.withLocale(options.locale);\n }\n\n return date;\n }\n\n /**\n * Creates a new DateTime from a timestamp.\n * @param {number} timestamp The number of seconds since the UNIX epoch.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @return {DateTime} A new DateTime instance.\n */\n static fromTimestamp(timestamp, options = {}) {\n return new this(null, options)\n .withTimestamp(timestamp);\n }\n\n /**\n * Gets the default locale.\n * @return {string} The locale.\n */\n static getDefaultLocale() {\n return config.defaultLocale;\n }\n\n /**\n * Gets the default time zone.\n * @return {string} The default time zone.\n */\n static getDefaultTimeZone() {\n return config.defaultTimeZone;\n }\n\n /**\n * Checks whether the year is a leap year.\n * @param {number} year The year.\n * @return {boolean} Whether the given year is a leap year.\n */\n static isLeapYear(year) {\n const date = new Date(0);\n date.setUTCFullYear(year, 1, 29);\n\n return date.getUTCDate() === 29;\n }\n\n /**\n * Creates a new DateTime for the current time.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @return {DateTime} A new DateTime instance.\n */\n static now(options = {}) {\n return new this(null, options);\n }\n\n /**\n * Sets whether dates will be clamped when changing months.\n * @param {boolean} clampDates Whether to clamp dates.\n */\n static setDateClamping(clampDates) {\n config.clampDates = clampDates;\n }\n\n /**\n * Sets the default locale.\n * @param {string} locale The locale.\n */\n static setDefaultLocale(locale) {\n config.defaultLocale = locale;\n }\n\n /**\n * Sets the default time zone.\n * @param {string} timeZone The time zone name.\n */\n static setDefaultTimeZone(timeZone) {\n config.defaultTimeZone = timeZone;\n }\n\n /**\n * Creates a new DateTime from the current time, epoch milliseconds, or a date string.\n * @param {string|number|null} [date=null] The source date. Numbers are interpreted as milliseconds since the UNIX epoch.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n */\n constructor(date = null, options = {}) {\n let timestamp;\n let adjustOffset = false;\n\n if (date === null) {\n timestamp = Date.now();\n } else if (typeof date === 'number' && Number.isFinite(date)) {\n timestamp = date;\n } else if (date === `${date}`) {\n timestamp = Date.parse(date);\n\n if (isNaN(timestamp)) {\n throw new Error('Invalid date string supplied');\n }\n\n adjustOffset = !dateStringTimeZoneRegExp.test(date);\n\n if (adjustOffset) {\n const localTimestamp = parseLocalTimestamp(date);\n\n if (localTimestamp === null) {\n timestamp -= new Date(timestamp).getTimezoneOffset() * 60000;\n } else {\n timestamp = localTimestamp;\n }\n }\n } else {\n throw new Error('Invalid date supplied');\n }\n\n this._date = new Date(timestamp);\n this._dynamicTz = false;\n this.isValid = true;\n\n let timeZone = options.timeZone;\n\n if (!timeZone) {\n timeZone = config.defaultTimeZone;\n }\n\n if (['Z', 'GMT'].includes(timeZone)) {\n timeZone = 'UTC';\n }\n\n const match = timeZone.match(offsetRegExp);\n if (match) {\n this._offset =\n match[2] * 60 +\n parseInt(match[4] || 0, 10) +\n parseInt(match[5] || 0, 10) / 60;\n if (this._offset && match[1] === '+') {\n this._offset *= -1;\n }\n\n if (this._offset) {\n this._timeZone = formatOffset(this._offset);\n } else {\n this._dynamicTz = true;\n this._timeZone = 'UTC';\n }\n } else {\n this._dynamicTz = true;\n this._timeZone = timeZone;\n }\n\n this._locale = 'locale' in options ?\n options.locale :\n config.defaultLocale;\n\n if (this._dynamicTz) {\n this._offset = getOffset(this);\n }\n\n if (adjustOffset && this._offset) {\n const resolvedDate = setOffsetTime(this, timestamp);\n this._date.setTime(resolvedDate.getTime());\n this._offset = resolvedDate.getTimeZoneOffset();\n }\n }\n\n /**\n * Adds a day to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addDay() {\n return this.addDays(1);\n }\n\n /**\n * Adds days to the current DateTime.\n * @param {number} amount The number of days to add.\n * @return {DateTime} A new DateTime instance.\n */\n addDays(amount) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(\n this.getDate() + amount,\n ),\n amount,\n );\n }\n\n /**\n * Adds an hour to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addHour() {\n return this.addHours(1);\n }\n\n /**\n * Adds hours to the current DateTime.\n * @param {number} amount The number of hours to add.\n * @return {DateTime} A new DateTime instance.\n */\n addHours(amount) {\n return this.withTime(\n this.getTime() + (amount * 3600000),\n );\n }\n\n /**\n * Adds a minute to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addMinute() {\n return this.addMinutes(1);\n }\n\n /**\n * Adds minutes to the current DateTime.\n * @param {number} amount The number of minutes to add.\n * @return {DateTime} A new DateTime instance.\n */\n addMinutes(amount) {\n return this.withTime(\n this.getTime() + (amount * 60000),\n );\n }\n\n /**\n * Adds a month to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addMonth() {\n return this.addMonths(1);\n }\n\n /**\n * Adds months to the current DateTime.\n * @param {number} amount The number of months to add.\n * @return {DateTime} A new DateTime instance.\n */\n addMonths(amount) {\n return this.withMonth(\n this.getMonth() + amount,\n );\n }\n\n /**\n * Adds a second to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addSecond() {\n return this.addSeconds(1);\n }\n\n /**\n * Adds seconds to the current DateTime.\n * @param {number} amount The number of seconds to add.\n * @return {DateTime} A new DateTime instance.\n */\n addSeconds(amount) {\n return this.withTime(\n this.getTime() + (amount * 1000),\n );\n }\n\n /**\n * Adds a week to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addWeek() {\n return this.addWeeks(1);\n }\n\n /**\n * Adds weeks to the current DateTime.\n * @param {number} amount The number of weeks to add.\n * @return {DateTime} A new DateTime instance.\n */\n addWeeks(amount) {\n return this.withDate(\n this.getDate() + (amount * 7),\n );\n }\n\n /**\n * Adds a year to the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n addYear() {\n return this.addYears(1);\n }\n\n /**\n * Adds years to the current DateTime.\n * @param {number} amount The number of years to add.\n * @return {DateTime} A new DateTime instance.\n */\n addYears(amount) {\n return this.withYear(\n this.getYear() + amount,\n );\n }\n\n /**\n * Gets the localized day name for the current date.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of day name to return.\n * @return {string} The localized day name.\n */\n dayName(type = 'long') {\n return formatDay(this.getLocale(), this.getDay(), type);\n }\n\n /**\n * Gets the localized day period for the current time.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of day period to return.\n * @return {string} The localized day period.\n */\n dayPeriod(type = 'long') {\n return formatDayPeriod(\n this.getLocale(),\n this.getHours() < 12 ?\n 0 :\n 1,\n type,\n );\n }\n\n /**\n * Gets the number of days in the current month.\n * @return {number} The number of days in the current month.\n */\n daysInMonth() {\n return this.constructor.daysInMonth(\n this.getYear(),\n this.getMonth(),\n );\n }\n\n /**\n * Gets the number of days in the current year.\n * @return {number} The number of days in the current year.\n */\n daysInYear() {\n return this.constructor.daysInYear(\n this.getYear(),\n );\n }\n\n /**\n * Gets the difference between this and another Date in milliseconds.\n * @param {DateTime} other The date to compare to.\n * @return {number} The difference.\n */\n diff(other) {\n return this - other;\n }\n\n /**\n * Gets the difference between this and another Date in days.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInDays(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'day', relative);\n }\n\n /**\n * Gets the difference between this and another Date in hours.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInHours(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'hour', relative);\n }\n\n /**\n * Gets the difference between this and another Date in minutes.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInMinutes(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'minute', relative);\n }\n\n /**\n * Gets the difference between this and another Date in months.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInMonths(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'month', relative);\n }\n\n /**\n * Gets the difference between this and another Date in seconds.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInSeconds(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'second', relative);\n }\n\n /**\n * Gets the difference between this and another Date in weeks.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInWeeks(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'week', relative);\n }\n\n /**\n * Gets the difference between this and another Date in years.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @return {number} The difference.\n */\n diffInYears(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'year', relative);\n }\n\n /**\n * Sets the DateTime to the end of the day.\n * @return {DateTime} A new DateTime instance.\n */\n endOfDay() {\n return this.withHours(23, 59, 59, 999);\n }\n\n /**\n * Sets the DateTime to the end of the hour.\n * @return {DateTime} A new DateTime instance.\n */\n endOfHour() {\n return this.withMinutes(59, 59, 999);\n }\n\n /**\n * Sets the DateTime to the end of the minute.\n * @return {DateTime} A new DateTime instance.\n */\n endOfMinute() {\n return this.withSeconds(59, 999);\n }\n\n /**\n * Sets the DateTime to the end of the month.\n * @return {DateTime} A new DateTime instance.\n */\n endOfMonth() {\n return this.withDate(this.daysInMonth())\n .endOfDay();\n }\n\n /**\n * Sets the DateTime to the end of the quarter.\n * @return {DateTime} A new DateTime instance.\n */\n endOfQuarter() {\n const month = this.getQuarter() * 3;\n return this.withMonth(month, this.constructor.daysInMonth(this.getYear(), month))\n .endOfDay();\n }\n\n /**\n * Sets the DateTime to the end of the second.\n * @return {DateTime} A new DateTime instance.\n */\n endOfSecond() {\n return this.withMilliseconds(999);\n }\n\n /**\n * Sets the DateTime to the end of the week.\n * @return {DateTime} A new DateTime instance.\n */\n endOfWeek() {\n return this.withWeekDay(7)\n .endOfDay();\n }\n\n /**\n * Sets the DateTime to the end of the year.\n * @return {DateTime} A new DateTime instance.\n */\n endOfYear() {\n return this.withMonth(12, 31)\n .endOfDay();\n }\n\n /**\n * Gets the localized era for the current date.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of era to return.\n * @return {string} The localized era.\n */\n era(type = 'long') {\n return formatEra(\n this.getLocale(),\n this.getYear() < 0 ?\n 0 :\n 1,\n type,\n );\n }\n\n /**\n * Formats the current date using a format string.\n * @param {string} formatString The format string.\n * @return {string} The formatted date string.\n */\n format(formatString) {\n let match;\n let output = '';\n\n while (formatString && (match = formatString.match(formatTokenRegExp))) {\n const token = match[1];\n const position = match.index;\n const length = match[0].length;\n\n if (position) {\n output += formatString.substring(0, position);\n }\n\n formatString = formatString.substring(position + length);\n\n if (!token) {\n output += decodeLiteral(match[0]);\n continue;\n }\n\n if (!(token in tokens)) {\n throw new Error(`Invalid token in DateTime format: ${token}`);\n }\n\n if (tokens[token].supportsLength?.(length) === false) {\n throw new Error(`Unsupported token in DateTime format: ${token.repeat(length)}`);\n }\n\n output += tokens[token].output(this, length);\n }\n\n output += formatString;\n\n return output;\n }\n\n /**\n * Gets the date of the month in the current time zone.\n * @return {number} The date of the month.\n */\n getDate() {\n return new Date(getOffsetTime(this)).getUTCDate();\n }\n\n /**\n * Gets the day of the week in the current time zone.\n * @return {number} The day of the week. (0 = Sunday, 6 = Saturday)\n */\n getDay() {\n return new Date(getOffsetTime(this)).getUTCDay();\n }\n\n /**\n * Gets the day of the year in the current time zone.\n * @return {number} The day of the year. (1-366)\n */\n getDayOfYear() {\n return this.constructor.dayOfYear(\n this.getYear(),\n this.getMonth(),\n this.getDate(),\n );\n }\n\n /**\n * Gets the hours of the day in the current time zone.\n * @return {number} The hours of the day. (0-23)\n */\n getHours() {\n return new Date(getOffsetTime(this)).getUTCHours();\n }\n\n /**\n * Gets the current locale.\n * @return {string} The locale.\n */\n getLocale() {\n return this._locale;\n }\n\n /**\n * Gets the milliseconds in the current time zone.\n * @return {number} The milliseconds.\n */\n getMilliseconds() {\n return new Date(getOffsetTime(this)).getUTCMilliseconds();\n }\n\n /**\n * Gets the minutes in the current time zone.\n * @return {number} The minutes. (0-59)\n */\n getMinutes() {\n return new Date(getOffsetTime(this)).getUTCMinutes();\n }\n\n /**\n * Gets the month in the current time zone.\n * @return {number} The month. (1-12)\n */\n getMonth() {\n return new Date(getOffsetTime(this)).getUTCMonth() + 1;\n }\n\n /**\n * Gets the quarter of the year in the current time zone.\n * @return {number} The quarter of the year. (1-4)\n */\n getQuarter() {\n return Math.ceil(this.getMonth() / 3);\n }\n\n /**\n * Gets the seconds in the current time zone.\n * @return {number} The seconds. (0-59)\n */\n getSeconds() {\n return new Date(getOffsetTime(this)).getUTCSeconds();\n }\n\n /**\n * Gets the number of milliseconds since the UNIX epoch.\n * @return {number} The number of milliseconds since the UNIX epoch.\n */\n getTime() {\n return this._date.getTime();\n }\n\n /**\n * Gets the number of seconds since the UNIX epoch.\n * @return {number} The number of seconds since the UNIX epoch.\n */\n getTimestamp() {\n return Math.floor(this.getTime() / 1000);\n }\n\n /**\n * Gets the current time zone.\n * @return {string} The time zone.\n */\n getTimeZone() {\n return this._timeZone;\n }\n\n /**\n * Gets the current UTC offset in minutes.\n * @return {number} The UTC offset in minutes.\n */\n getTimeZoneOffset() {\n return this._offset;\n }\n\n /**\n * Gets the local week in the current time zone.\n * @return {number} The local week. (1-53)\n */\n getWeek() {\n const thisWeek = this.startOfDay().withWeekDay(1);\n const firstWeek = thisWeek.withWeek(1, 1);\n\n return 1 + Math.floor(\n (getOffsetTime(thisWeek) - getOffsetTime(firstWeek)) /\n 604800000,\n );\n }\n\n /**\n * Gets the local day of the week in the current time zone.\n * @return {number} The local day of the week. (1-7)\n */\n getWeekDay() {\n return weekDay(\n this.getLocale(),\n this.getDay(),\n );\n }\n\n /**\n * Gets the week day in month in the current time zone.\n * @return {number} The week day in month.\n */\n getWeekDayInMonth() {\n const thisWeek = this.getWeek();\n const first = this.withDate(1);\n const firstWeek = first.getWeek();\n const offset = first.getWeekDay() > this.getWeekDay() ?\n 0 : 1;\n return firstWeek > thisWeek ?\n thisWeek + offset :\n thisWeek - firstWeek + offset;\n }\n\n /**\n * Gets the week of month in the current time zone.\n * @return {number} The week of month.\n */\n getWeekOfMonth() {\n const thisWeek = this.getWeek();\n const firstWeek = this.withDate(1).getWeek();\n return firstWeek > thisWeek ?\n thisWeek + 1 :\n thisWeek - firstWeek + 1;\n }\n\n /**\n * Gets the week year in the current time zone.\n * @return {number} The week year.\n */\n getWeekYear() {\n const minDays = minimumDays(this.getLocale());\n return this.withWeekDay(7 - minDays + 1).getYear();\n }\n\n /**\n * Gets the year in the current time zone.\n * @return {number} The year.\n */\n getYear() {\n return new Date(getOffsetTime(this)).getUTCFullYear();\n }\n\n /**\n * Gets the difference between this and another Date in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in human readable form.\n */\n humanDiff(other) {\n const [amount, unit] = getBiggestDiff(this, other);\n return formatRelative(this.getLocale(), amount, unit);\n }\n\n /**\n * Gets the difference between this and another Date in days in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in days in human readable form.\n */\n humanDiffInDays(other) {\n return formatRelative(this.getLocale(), this.diffInDays(other), 'day');\n }\n\n /**\n * Gets the difference between this and another Date in hours in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in hours in human readable form.\n */\n humanDiffInHours(other) {\n return formatRelative(this.getLocale(), this.diffInHours(other), 'hour');\n }\n\n /**\n * Gets the difference between this and another Date in minutes in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in minutes in human readable form.\n */\n humanDiffInMinutes(other) {\n return formatRelative(this.getLocale(), this.diffInMinutes(other), 'minute');\n }\n\n /**\n * Gets the difference between this and another Date in months in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in months in human readable form.\n */\n humanDiffInMonths(other) {\n return formatRelative(this.getLocale(), this.diffInMonths(other), 'month');\n }\n\n /**\n * Gets the difference between this and another Date in seconds in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in seconds in human readable form.\n */\n humanDiffInSeconds(other) {\n return formatRelative(this.getLocale(), this.diffInSeconds(other), 'second');\n }\n\n /**\n * Gets the difference between this and another Date in weeks in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in weeks in human readable form.\n */\n humanDiffInWeeks(other) {\n return formatRelative(this.getLocale(), this.diffInWeeks(other), 'week');\n }\n\n /**\n * Gets the difference between this and another Date in years in human readable form.\n * @param {DateTime} other The date to compare to.\n * @return {string} The difference in years in human readable form.\n */\n humanDiffInYears(other) {\n return formatRelative(this.getLocale(), this.diffInYears(other), 'year');\n }\n\n /**\n * Checks whether this DateTime is after another date.\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date.\n */\n isAfter(other) {\n return this.diff(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by day).\n */\n isAfterDay(other) {\n return this.diffInDays(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by hour).\n */\n isAfterHour(other) {\n return this.diffInHours(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by minute).\n */\n isAfterMinute(other) {\n return this.diffInMinutes(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by month).\n */\n isAfterMonth(other) {\n return this.diffInMonths(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by second).\n */\n isAfterSecond(other) {\n return this.diffInSeconds(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by week).\n */\n isAfterWeek(other) {\n return this.diffInWeeks(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is after the other date (comparing by year).\n */\n isAfterYear(other) {\n return this.diffInYears(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is before another date.\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date.\n */\n isBefore(other) {\n return this.diff(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by day).\n */\n isBeforeDay(other) {\n return this.diffInDays(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by hour).\n */\n isBeforeHour(other) {\n return this.diffInHours(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by minute).\n */\n isBeforeMinute(other) {\n return this.diffInMinutes(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by month).\n */\n isBeforeMonth(other) {\n return this.diffInMonths(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by second).\n */\n isBeforeSecond(other) {\n return this.diffInSeconds(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by week).\n */\n isBeforeWeek(other) {\n return this.diffInWeeks(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is before the other date (comparing by year).\n */\n isBeforeYear(other) {\n return this.diffInYears(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is between two other dates.\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates.\n */\n isBetween(start, end) {\n return this.isAfter(start) && this.isBefore(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by day).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by day).\n */\n isBetweenDay(start, end) {\n return this.isAfterDay(start) && this.isBeforeDay(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by hour).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by hour).\n */\n isBetweenHour(start, end) {\n return this.isAfterHour(start) && this.isBeforeHour(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by minute).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by minute).\n */\n isBetweenMinute(start, end) {\n return this.isAfterMinute(start) && this.isBeforeMinute(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by month).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by month).\n */\n isBetweenMonth(start, end) {\n return this.isAfterMonth(start) && this.isBeforeMonth(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by second).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by second).\n */\n isBetweenSecond(start, end) {\n return this.isAfterSecond(start) && this.isBeforeSecond(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by week).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by week).\n */\n isBetweenWeek(start, end) {\n return this.isAfterWeek(start) && this.isBeforeWeek(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by year).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @return {boolean} Whether this DateTime is between two other dates (comparing by year).\n */\n isBetweenYear(start, end) {\n return this.isAfterYear(start) && this.isBeforeYear(end);\n }\n\n /**\n * Checks whether the DateTime is in daylight saving time.\n * @return {boolean} Whether the current time is in daylight saving time.\n */\n isDst() {\n if (!this._dynamicTz) {\n return false;\n }\n\n const year = this.getYear();\n const dateA = this.constructor.fromArray([year, 1, 1], {\n timeZone: this.getTimeZone(),\n });\n const dateB = this.constructor.fromArray([year, 6, 1], {\n timeZone: this.getTimeZone(),\n });\n\n return this.getTimeZoneOffset() < Math.max(dateA.getTimeZoneOffset(), dateB.getTimeZoneOffset());\n }\n\n /**\n * Checks whether the year is a leap year.\n * @return {boolean} Whether the current year is a leap year.\n */\n isLeapYear() {\n return this.constructor.isLeapYear(\n this.getYear(),\n );\n }\n\n /**\n * Checks whether this DateTime is the same as another date.\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date.\n */\n isSame(other) {\n return this.diff(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by day).\n */\n isSameDay(other) {\n return this.diffInDays(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by hour).\n */\n isSameHour(other) {\n return this.diffInHours(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by minute).\n */\n isSameMinute(other) {\n return this.diffInMinutes(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by month).\n */\n isSameMonth(other) {\n return this.diffInMonths(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date.\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date.\n */\n isSameOrAfter(other) {\n return this.diff(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by day).\n */\n isSameOrAfterDay(other) {\n return this.diffInDays(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by hour).\n */\n isSameOrAfterHour(other) {\n return this.diffInHours(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by minute).\n */\n isSameOrAfterMinute(other) {\n return this.diffInMinutes(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by month).\n */\n isSameOrAfterMonth(other) {\n return this.diffInMonths(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by second).\n */\n isSameOrAfterSecond(other) {\n return this.diffInSeconds(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by week).\n */\n isSameOrAfterWeek(other) {\n return this.diffInWeeks(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or after the other date (comparing by year).\n */\n isSameOrAfterYear(other) {\n return this.diffInYears(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date.\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date.\n */\n isSameOrBefore(other) {\n return this.diff(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by day).\n */\n isSameOrBeforeDay(other) {\n return this.diffInDays(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by hour).\n */\n isSameOrBeforeHour(other) {\n return this.diffInHours(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by minute).\n */\n isSameOrBeforeMinute(other) {\n return this.diffInMinutes(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by month).\n */\n isSameOrBeforeMonth(other) {\n return this.diffInMonths(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by second).\n */\n isSameOrBeforeSecond(other) {\n return this.diffInSeconds(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by week).\n */\n isSameOrBeforeWeek(other) {\n return this.diffInWeeks(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as or before the other date (comparing by year).\n */\n isSameOrBeforeYear(other) {\n return this.diffInYears(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by second).\n */\n isSameSecond(other) {\n return this.diffInSeconds(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by week).\n */\n isSameWeek(other) {\n return this.diffInWeeks(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @return {boolean} Whether this DateTime is the same as the other date (comparing by year).\n */\n isSameYear(other) {\n return this.diffInYears(other) === 0;\n }\n\n /**\n * Gets the localized month name for the current date.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of month name to return.\n * @return {string} The localized month name.\n */\n monthName(type = 'long') {\n return formatMonth(this.getLocale(), this.getMonth(), type);\n }\n\n /**\n * Sets the DateTime to the start of the day.\n * @return {DateTime} A new DateTime instance.\n */\n startOfDay() {\n return this.withHours(0, 0, 0, 0);\n }\n\n /**\n * Sets the DateTime to the start of the hour.\n * @return {DateTime} A new DateTime instance.\n */\n startOfHour() {\n return this.withMinutes(0, 0, 0);\n }\n\n /**\n * Sets the DateTime to the start of the minute.\n * @return {DateTime} A new DateTime instance.\n */\n startOfMinute() {\n return this.withSeconds(0, 0);\n }\n\n /**\n * Sets the DateTime to the start of the month.\n * @return {DateTime} A new DateTime instance.\n */\n startOfMonth() {\n return this.withDate(1)\n .startOfDay();\n }\n\n /**\n * Sets the DateTime to the start of the quarter.\n * @return {DateTime} A new DateTime instance.\n */\n startOfQuarter() {\n const month = this.getQuarter() * 3 - 2;\n return this.withMonth(month, 1)\n .startOfDay();\n }\n\n /**\n * Sets the DateTime to the start of the second.\n * @return {DateTime} A new DateTime instance.\n */\n startOfSecond() {\n return this.withMilliseconds(0);\n }\n\n /**\n * Sets the DateTime to the start of the week.\n * @return {DateTime} A new DateTime instance.\n */\n startOfWeek() {\n return this.withWeekDay(1)\n .startOfDay();\n }\n\n /**\n * Sets the DateTime to the start of the year.\n * @return {DateTime} A new DateTime instance.\n */\n startOfYear() {\n return this.withMonth(1, 1)\n .startOfDay();\n }\n\n /**\n * Subtracts a day from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subDay() {\n return this.addDays(-1);\n }\n\n /**\n * Subtracts days from the current DateTime.\n * @param {number} amount The number of days to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subDays(amount) {\n return this.addDays(-amount);\n }\n\n /**\n * Subtracts an hour from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subHour() {\n return this.addHours(-1);\n }\n\n /**\n * Subtracts hours from the current DateTime.\n * @param {number} amount The number of hours to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subHours(amount) {\n return this.addHours(-amount);\n }\n\n /**\n * Subtracts a minute from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subMinute() {\n return this.addMinutes(-1);\n }\n\n /**\n * Subtracts minutes from the current DateTime.\n * @param {number} amount The number of minutes to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subMinutes(amount) {\n return this.addMinutes(-amount);\n }\n\n /**\n * Subtracts a month from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subMonth() {\n return this.addMonths(-1);\n }\n\n /**\n * Subtracts months from the current DateTime.\n * @param {number} amount The number of months to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subMonths(amount) {\n return this.addMonths(-amount);\n }\n\n /**\n * Subtracts a second from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subSecond() {\n return this.addSeconds(-1);\n }\n\n /**\n * Subtracts seconds from the current DateTime.\n * @param {number} amount The number of seconds to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subSeconds(amount) {\n return this.addSeconds(-amount);\n }\n\n /**\n * Subtracts a week from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subWeek() {\n return this.addWeeks(-1);\n }\n\n /**\n * Subtracts weeks from the current DateTime.\n * @param {number} amount The number of weeks to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subWeeks(amount) {\n return this.addWeeks(-amount);\n }\n\n /**\n * Subtracts a year from the current DateTime.\n * @return {DateTime} A new DateTime instance.\n */\n subYear() {\n return this.addYears(-1);\n }\n\n /**\n * Subtracts years from the current DateTime.\n * @param {number} amount The number of years to subtract.\n * @return {DateTime} A new DateTime instance.\n */\n subYears(amount) {\n return this.addYears(-amount);\n }\n\n /**\n * Returns the primitive representation of the DateTime.\n * @param {'default'|'number'|'string'} hint The conversion hint.\n * @return {string|number} A string for default/string coercion or epoch milliseconds for numeric coercion.\n */\n [Symbol.toPrimitive](hint) {\n return hint === 'number' ?\n this.valueOf() :\n this.toString();\n }\n\n /**\n * Gets the name of the current time zone.\n * @param {'long'|'short'} [type='long'] The formatting type.\n * @return {string} The name of the time zone.\n */\n timeZoneName(type = 'long') {\n return this._dynamicTz ?\n formatTimeZoneName(this.getLocale(), this.getTime(), this.getTimeZone(), type) :\n 'GMT' + formatOffset(this.getTimeZoneOffset(), true, type === 'short');\n }\n\n /**\n * Formats the current date using \"eee MMM dd yyyy\".\n * @return {string} The formatted date string.\n */\n toDateString() {\n return this.format(formats.date);\n }\n\n /**\n * Formats the current date using \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\".\n * @return {string} The formatted date string.\n */\n toIsoString() {\n return this\n .withLocale('en')\n .withTimeZone('UTC')\n .format(formats.rfc3339_extended);\n }\n\n /**\n * Returns the JSON representation of the current date.\n * @return {string|null} The ISO string for valid dates or null for invalid dates.\n */\n toJSON() {\n return this.isValid ?\n this.toIsoString() :\n null;\n }\n\n /**\n * Formats the current date using \"eee MMM dd yyyy HH:mm:ss xx (VV)\".\n * @return {string} The formatted date string.\n */\n toString() {\n return this.format(formats.string);\n }\n\n /**\n * Formats the current date using \"HH:mm:ss xx (VV)\".\n * @return {string} The formatted date string.\n */\n toTimeString() {\n return this.format(formats.time);\n }\n\n /**\n * Formats the current date in the UTC time zone using \"eee MMM dd yyyy HH:mm:ss xx (VV)\".\n * @return {string} The formatted date string.\n */\n toUTCString() {\n return this\n .withLocale('en')\n .withTimeZone('UTC')\n .toString();\n }\n\n /**\n * Returns the number of milliseconds since the UNIX epoch.\n * @return {number} The number of milliseconds since the UNIX epoch.\n */\n valueOf() {\n return this.getTime();\n }\n\n /**\n * Gets the number of weeks in the current year.\n * @return {number} The number of weeks in the current year.\n */\n weeksInYear() {\n const minDays = minimumDays(this.getLocale());\n return this.withMonth(12, 24 + minDays).getWeek();\n }\n\n /**\n * Returns a copy with the date of the month changed in the current time zone.\n * @param {number} date The date of the month.\n * @return {DateTime} A new DateTime instance.\n */\n withDate(date) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(date),\n );\n }\n\n /**\n * Returns a copy with the day of the week changed in the current time zone.\n * @param {number} day The day of the week. (0 = Sunday, 6 = Saturday)\n * @return {DateTime} A new DateTime instance.\n */\n withDay(day) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(\n this.getDate() -\n this.getDay() +\n parseInt(day, 10),\n ),\n );\n }\n\n /**\n * Returns a copy with the day of the year changed in the current time zone.\n * @param {number} day The day of the year. (1-366)\n * @return {DateTime} A new DateTime instance.\n */\n withDayOfYear(day) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMonth(\n 0,\n day,\n ),\n );\n }\n\n /**\n * Returns a copy with the hours changed in the current time zone.\n * @param {number} hours The hours. (0-23)\n * @param {number} [minutes] The minutes. (0-59)\n * @param {number} [seconds] The seconds. (0-59)\n * @param {number} [milliseconds] The milliseconds.\n * @return {DateTime} A new DateTime instance.\n */\n withHours(...args) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCHours(...args),\n );\n }\n\n /**\n * Returns a copy with a different locale.\n * @param {string} locale The locale to use.\n * @return {DateTime} A new DateTime instance.\n */\n withLocale(locale) {\n return new this.constructor(this.getTime(), {\n locale,\n timeZone: this._timeZone,\n });\n }\n\n /**\n * Returns a copy with the milliseconds changed in the current time zone.\n * @param {number} milliseconds The milliseconds.\n * @return {DateTime} A new DateTime instance.\n */\n withMilliseconds(milliseconds) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMilliseconds(milliseconds),\n );\n }\n\n /**\n * Returns a copy with the minutes changed in the current time zone.\n * @param {number} minutes The minutes. (0-59)\n * @param {number} [seconds] The seconds. (0-59)\n * @param {number} [milliseconds] The milliseconds.\n * @return {DateTime} A new DateTime instance.\n */\n withMinutes(...args) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMinutes(...args),\n );\n }\n\n /**\n * Returns a copy with the month changed in the current time zone.\n * @param {number} month The month. (1-12)\n * @param {number|null} [date] The date of the month.\n * @return {DateTime} A new DateTime instance.\n */\n withMonth(month, date = null) {\n if (date === null) {\n date = this.getDate();\n\n if (config.clampDates) {\n date = Math.min(\n date,\n this.constructor.daysInMonth(\n this.getYear(),\n month,\n ),\n );\n }\n }\n\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMonth(\n month - 1,\n date,\n ),\n );\n }\n\n /**\n * Returns a copy with the quarter of the year changed in the current time zone.\n * @param {number} quarter The quarter of the year. (1-4)\n * @return {DateTime} A new DateTime instance.\n */\n withQuarter(quarter) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMonth(\n quarter * 3 -\n 3,\n ),\n );\n }\n\n /**\n * Returns a copy with the seconds changed in the current time zone.\n * @param {number} seconds The seconds. (0-59)\n * @param {number} [milliseconds] The milliseconds.\n * @return {DateTime} A new DateTime instance.\n */\n withSeconds(...args) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCSeconds(...args),\n );\n }\n\n /**\n * Returns a copy with a different epoch-millisecond value.\n * @param {number} time The number of milliseconds since the UNIX epoch.\n * @return {DateTime} A new DateTime instance.\n */\n withTime(time) {\n return new this.constructor(time, {\n locale: this._locale,\n timeZone: this._timeZone,\n });\n }\n\n /**\n * Returns a copy with a different number of seconds since the UNIX epoch.\n * @param {number} timestamp The number of seconds since the UNIX epoch.\n * @return {DateTime} A new DateTime instance.\n */\n withTimestamp(timestamp) {\n return this.withTime(timestamp * 1000);\n }\n\n /**\n * Returns a copy in a different time zone.\n * @param {string} timeZone The time zone to use.\n * @return {DateTime} A new DateTime instance.\n */\n withTimeZone(timeZone) {\n return new this.constructor(this.getTime(), {\n locale: this._locale,\n timeZone,\n });\n }\n\n /**\n * Returns a copy with a fixed numeric UTC offset.\n * @param {number} offset The UTC offset in minutes.\n * @return {DateTime} A new DateTime instance.\n */\n withTimeZoneOffset(offset) {\n return new this.constructor(this.getTime(), {\n locale: this._locale,\n timeZone: formatOffset(offset),\n });\n }\n\n /**\n * Returns a copy with the local week changed in the current time zone.\n * @param {number} week The local week.\n * @param {number|null} [day] The local day of the week. (1-7)\n * @return {DateTime} A new DateTime instance.\n */\n withWeek(week, day = null) {\n if (day === null) {\n day = this.getWeekDay();\n }\n\n const minDays = minimumDays(this.getLocale());\n return this.withYear(this.getWeekYear(), 1, minDays + ((week - 1) * 7)).withWeekDay(day);\n }\n\n /**\n * Returns a copy with the local day of the week changed in the current time zone.\n * @param {number} day The local day of the week. (1-7)\n * @return {DateTime} A new DateTime instance.\n */\n withWeekDay(day) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(\n this.getDate() -\n this.getWeekDay() +\n parseInt(day, 10),\n ),\n );\n }\n\n /**\n * Returns a copy with the week day in month changed in the current time zone.\n * @param {number} week The week day in month.\n * @return {DateTime} A new DateTime instance.\n */\n withWeekDayInMonth(week) {\n return this.withDate(\n this.getDate() +\n (\n week -\n this.getWeekDayInMonth()\n ) * 7,\n );\n }\n\n /**\n * Returns a copy with the week of month changed in the current time zone.\n * @param {number} week The week of month.\n * @return {DateTime} A new DateTime instance.\n */\n withWeekOfMonth(week) {\n return this.withDate(\n this.getDate() +\n (\n week -\n this.getWeekOfMonth()\n ) * 7,\n );\n }\n\n /**\n * Returns a copy with the local week year changed in the current time zone.\n * @param {number} year The local week year.\n * @param {number|null} [week] The local week.\n * @param {number|null} [day] The local day of the week. (1-7)\n * @return {DateTime} A new DateTime instance.\n */\n withWeekYear(year, week = null, day = null) {\n const minDays = minimumDays(this.getLocale());\n const Constructor = this.constructor;\n\n if (week === null) {\n week = Math.min(\n this.getWeek(),\n Constructor.fromArray([year, 1, minDays], {\n locale: this.getLocale(),\n timeZone: this.getTimeZone(),\n }).weeksInYear(),\n );\n }\n\n if (day === null) {\n day = this.getWeekDay();\n }\n\n return this.withYear(year, 1, minDays + ((week - 1) * 7)).withWeekDay(day);\n }\n\n /**\n * Returns a copy with the year changed in the current time zone.\n * @param {number} year The year.\n * @param {number|null} [month] The month. (1-12)\n * @param {number|null} [date] The date of the month.\n * @return {DateTime} A new DateTime instance.\n */\n withYear(year, month = null, date = null) {\n if (month === null) {\n month = this.getMonth();\n }\n\n if (date === null) {\n date = this.getDate();\n\n if (config.clampDates) {\n date = Math.min(\n date,\n this.constructor.daysInMonth(\n year,\n month,\n ),\n );\n }\n }\n\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCFullYear(\n year,\n month - 1,\n date,\n ),\n );\n }\n}\n"],"mappings":"wOAIA,MAAMA,EAAO,IAAIC,IAgBV,SAASC,EAAQC,EAAKC,GAKzB,OAJKJ,EAAKK,IAAIF,IACVH,EAAKM,IAAIH,EAAKC,KAGXJ,EAAKO,IAAIJ,EACpB,CAkDO,SAASK,EAAcC,EAAQC,GAClC,OAAO,IAAIC,KAAKC,eAAeH,EAAQ,CACnCI,SAAU,SACPH,EACHI,SAAU,WAElB,CC9EA,MAAMC,GAAkB,IAAIJ,KAAKC,gBAAiBG,kBAErCC,EAAS,CAClBC,YAAY,EACZC,cAAeH,EAAgBN,OAC/BU,gBAAiBJ,EAAgBF,UAGxBO,EAA2B,4FAE3BC,EACH,kBADGA,EAES,+BAFTA,EAGD,mCAHCA,EAIH,mBAGGC,EAAoB,gCAEpBC,EAAY,CAAC,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GA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AGyU,EAAwB,GAAZtW,EAAO,IAAS4Q,YAAY3Q,EACxF,CAOA,WAAA2Q,CAAY3Q,GACR,OAAO4D,EACH0K,KACA,IAAI9N,KAAK6C,EAAciL,OAAOoF,WAC1BpF,KAAK1N,UACL0N,KAAK5B,aACL9D,SAAS5I,EAAK,KAG1B,CAOA,kBAAA6Q,CAAmB9Q,GACf,OAAOuO,KAAK0B,SACR1B,KAAK1N,UAID,GAFAb,EACAuO,KAAKhC,qBAGjB,CAOA,eAAAyE,CAAgBhR,GACZ,OAAOuO,KAAK0B,SACR1B,KAAK1N,UAID,GAFAb,EACAuO,KAAKrC,kBAGjB,CASA,YAAAtK,CAAa9B,EAAME,EAAO,KAAMC,EAAM,MAClC,MAAMqW,EAAU/L,EAAYgE,KAAK5M,aAC3Bob,EAAcxO,KAAK0D,YAgBzB,OAda,OAATjS,IACAA,EAAOmD,KAAKuK,IACRa,KAAKzM,UACLib,EAAYlO,UAAU,CAAC/O,EAAM,EAAGwW,GAAU,CACtC1X,OAAQ2P,KAAK5M,YACb3C,SAAUuP,KAAKnN,gBAChBmb,gBAIC,OAARtc,IACAA,EAAMsO,KAAK5B,cAGR4B,KAAKjN,SAASxB,EAAM,EAAGwW,EAAwB,GAAZtW,EAAO,IAAS4Q,YAAY3Q,EAC1E,CASA,QAAAqB,CAASxB,EAAMC,EAAQ,KAAMQ,EAAO,MAmBhC,OAlBc,OAAVR,IACAA,EAAQwO,KAAK3N,YAGJ,OAATL,IACAA,EAAOgO,KAAK1N,UAER1B,EAAOC,aACPmB,EAAO4C,KAAKuK,IACRnN,EACAgO,KAAK0D,YAAYzD,YACb1O,EACAC,MAMT8D,EACH0K,KACA,IAAI9N,KAAK6C,EAAciL,OAAO7N,eAC1BZ,EACAC,EAAQ,EACRQ,GAGZ,E","ignoreList":[]}
1
+ {"version":3,"names":["data","Map","getData","key","callback","has","set","get","makeFormatter","locale","options","Intl","DateTimeFormat","timeZone","calendar","resolvedOptions","config","clampDates","defaultLocale","defaultTimeZone","dateStringTimeZoneRegExp","formats","formatTokenRegExp","monthDays","offsetRegExp","parseOrderKeys","diffMethods","year","month","week","day","hour","minute","second","thresholds","calendarDay","date","calendarDate","Date","setUTCFullYear","getYear","getMonth","getDate","getTime","calculateDiff","other","timeUnit","relative","withTimeZone","getTimeZone","compensateDiff","withYear","dateWeek","startOfWeek","otherWeek","withLocale","getLocale","withWeekYear","getWeekYear","getWeek","withHours","getHours","getMinutes","getSeconds","Error","valuesRegExp","values","slice","sort","a","b","length","map","value","replace","escapeRegExp","join","amount","compensate","compensation","Math","floor","ceil","getOffsetTime","getTimeZoneOffset","parseCompare","formatString","dateString","i","char","setOffsetTime","time","direction","newDate","withTime","newOffsetTime","adjustedDate","adjustedOffsetTime","getDayPeriods","type","dayPeriodFormatter","hourCycle","Array","fill","_","index","formatToParts","UTC","find","part","getDays","standalone","dayFormatter","weekday","format","getEras","eraFormatter","era","getMonths","monthFormatter","getNumbers","numberFormatter","numberRegExp","quantifier","formatDay","formatMonth","formatNumber","number","padding","numbers","padStart","match","formatOffset","offset","useColon","optionalMinutes","includeSeconds","absoluteSeconds","abs","totalSeconds","round","precision","Number","EPSILON","max","roundingError","isFinite","hours","minutes","seconds","sign","parts","push","formatRelative","unit","relativeFormatter","RelativeTimeFormat","numeric","style","getRelativeFormatter","weekStart","minDaysInFirstWeek","generatedValue","candidates","fallback","candidate","valueLocales","Object","entries","includes","parseInt","getWeekInfo","localeData","Locale","runtimeInfo","weekInfo","firstDay","minimalDays","regionOverride","toString","split","region","language","script","filter","toLowerCase","localeCandidates","phpFirstDay","decodeLiteral","literal","getType","getTokenRegExp","source","nextSource","previousNumeric","numberSource","minimumDays","weekDay","parseDay","indexOf","parseMonth","parseNumberString","from","digit","parseNumber","tokens","G","regex","input","parseEra","output","datetime","y","Y","Q","supportsLength","getQuarter","q","M","parsing","L","w","W","getWeekOfMonth","d","D","getDayOfYear","F","getWeekDayInMonth","E","getDay","e","getWeekDay","c","parseDayPeriod","dayPeriod","h","H","K","k","m","s","S","padEnd","milliseconds","getMilliseconds","z","min","timeZoneName","Z","prefix","O","V","X","x","DateTime","clearDataCache","clear","dayOfYear","reduce","this","daysInMonth","getUTCMonth","isLeapYear","getUTCFullYear","daysInYear","fromArray","dateArray","dateValues","timeValues","withTimestamp","fromDate","fromFormat","requestedTimeZone","previousTokenNumeric","token","position","substring","repeat","nextToken","nextLength","matchedValue","RegExp","methods","isPM","lastAM","withDate","withDayOfYear","hours12","hours24","withMilliseconds","withMinutes","withMonth","quarter","withQuarter","withSeconds","withWeek","withWeekDay","weekDayInMonth","withWeekDayInMonth","weekOfMonth","withWeekOfMonth","weekYear","parseFactory","testValues","subKeys","subKey","isValid","fromISOString","fromTimestamp","timestamp","getDefaultLocale","getDefaultTimeZone","getUTCDate","now","setDateClamping","setDefaultLocale","setDefaultTimeZone","constructor","adjustOffset","parse","isNaN","test","localTimestamp","fraction","setUTCHours","parseLocalTimestamp","getTimezoneOffset","_date","_dynamicTz","_offset","_timeZone","_locale","fromEntries","fractionalSecondDigits","getDateFormatter","localDate","localTime","fractionalSecond","getOffset","resolvedDate","setTime","addDay","addDays","setUTCDate","addHour","addHours","addMinute","addMinutes","addMonth","addMonths","addSecond","addSeconds","addWeek","addWeeks","addYear","addYears","dayName","period","formatDayPeriod","diff","diffInDays","diffInHours","diffInMinutes","diffInMonths","diffInSeconds","diffInWeeks","diffInYears","endOfDay","endOfHour","endOfMinute","endOfMonth","endOfQuarter","endOfSecond","endOfWeek","endOfYear","formatEra","getUTCDay","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCSeconds","getTimestamp","thisWeek","startOfDay","firstWeek","first","minDays","humanDiff","lastResult","diffMethod","relativeDiff","getBiggestDiff","humanDiffInDays","humanDiffInHours","humanDiffInMinutes","humanDiffInMonths","humanDiffInSeconds","humanDiffInWeeks","humanDiffInYears","isAfter","isAfterDay","isAfterHour","isAfterMinute","isAfterMonth","isAfterSecond","isAfterWeek","isAfterYear","isBefore","isBeforeDay","isBeforeHour","isBeforeMinute","isBeforeMonth","isBeforeSecond","isBeforeWeek","isBeforeYear","isBetween","start","end","isBetweenDay","isBetweenHour","isBetweenMinute","isBetweenMonth","isBetweenSecond","isBetweenWeek","isBetweenYear","isDst","dateA","dateB","isSame","isSameDay","isSameHour","isSameMinute","isSameMonth","isSameOrAfter","isSameOrAfterDay","isSameOrAfterHour","isSameOrAfterMinute","isSameOrAfterMonth","isSameOrAfterSecond","isSameOrAfterWeek","isSameOrAfterYear","isSameOrBefore","isSameOrBeforeDay","isSameOrBeforeHour","isSameOrBeforeMinute","isSameOrBeforeMonth","isSameOrBeforeSecond","isSameOrBeforeWeek","isSameOrBeforeYear","isSameSecond","isSameWeek","isSameYear","monthName","startOfHour","startOfMinute","startOfMonth","startOfQuarter","startOfSecond","startOfYear","subDay","subDays","subHour","subHours","subMinute","subMinutes","subMonth","subMonths","subSecond","subSeconds","subWeek","subWeeks","subYear","subYears","Symbol","toPrimitive","hint","valueOf","formatTimeZoneName","toDateString","toIsoString","toJSON","toTimeString","toUTCString","weeksInYear","withDay","setUTCMonth","args","setUTCMilliseconds","setUTCMinutes","setUTCSeconds","withTimeZoneOffset","Constructor"],"sources":["../src/factory.js","../src/vars.js","../src/helpers.js","../src/formatter/values.js","../src/formatter/format.js","../src/formatter/locales.js","../src/formatter/locale.js","../src/formatter/utility.js","../src/formatter/parse.js","../src/formatter/tokens.js","../src/date-time.js"],"sourcesContent":["/**\n * DateTime Factory\n */\n\nconst data = new Map();\n\n/**\n * Clears all cached formatter and locale values.\n */\nexport function clearDataCache() {\n data.clear();\n};\n\n/**\n * Gets a cached value, creating it on first access.\n * @template T\n * @param {string} key The key for the values.\n * @param {() => T} callback The callback to generate the values.\n * @returns {T} The cached value.\n */\nexport function getData(key, callback) {\n if (!data.has(key)) {\n data.set(key, callback());\n }\n\n return data.get(key);\n};\n\n/**\n * Creates a date formatter for a time zone.\n * @param {string} timeZone The time zone.\n * @returns {Intl.DateTimeFormat} The formatter instance.\n */\nexport function getDateFormatter(timeZone) {\n return getData(\n `dateFormatter.${timeZone}`,\n () => makeFormatter('en', {\n timeZone,\n hourCycle: 'h23',\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n }),\n );\n};\n\n/**\n * Creates a relative-time formatter for a locale.\n * @param {string} locale The locale.\n * @returns {Intl.RelativeTimeFormat|null} The formatter instance, or null when unsupported.\n */\nexport function getRelativeFormatter(locale) {\n if (!('RelativeTimeFormat' in Intl)) {\n return null;\n }\n\n return getData(\n `relativeFormatter.${locale}`,\n () => new Intl.RelativeTimeFormat(locale, {\n numeric: 'auto',\n style: 'long',\n }),\n );\n};\n\n/**\n * Creates a formatter for a locale.\n * @param {string} locale The locale.\n * @param {Intl.DateTimeFormatOptions} options The options for the formatter.\n * @returns {Intl.DateTimeFormat} The formatter instance.\n */\nexport function makeFormatter(locale, options) {\n return new Intl.DateTimeFormat(locale, {\n timeZone: 'UTC',\n ...options,\n calendar: 'gregory',\n });\n};\n","/**\n * DateTime Variables\n */\n\nconst resolvedOptions = new Intl.DateTimeFormat().resolvedOptions();\n\nexport const config = {\n clampDates: true,\n defaultLocale: resolvedOptions.locale,\n defaultTimeZone: resolvedOptions.timeZone,\n};\n\nexport const dateStringTimeZoneRegExp = /(?:\\b(?:UTC|GMT)\\b|[T\\s]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{3})?)?(?:Z|[+-]\\d{2}(?::?\\d{2})?)\\b)/i;\n\nexport const formats = {\n date: 'eee MMM dd yyyy',\n rfc3339_extended: `yyyy-MM-dd'T'HH:mm:ss.SSSxxx`,\n string: 'eee MMM dd yyyy HH:mm:ss xx (VV)',\n time: 'HH:mm:ss xx (VV)',\n};\n\nexport const formatTokenRegExp = /([a-z])\\1*|''|'(?:[^']|'')*'/i;\n\nexport const monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nexport const offsetRegExp = /^(?:GMT)?([+-])([01]\\d|2[0-3])(?:(:?)([0-5]\\d)(?:\\3([0-5]\\d))?)?$/;\n\nexport const parseOrderKeys = [\n ['year', 'weekYear'],\n ['era'],\n ['quarter', 'month', 'week', 'dayOfYear'],\n ['weekOfMonth'],\n ['date', 'weekDay'],\n ['weekDayInMonth'],\n ['hours24', 'hours12', 'dayPeriod'],\n ['minutes', 'seconds', 'milliseconds'],\n];\n\nexport const diffMethods = {\n year: 'diffInYears',\n month: 'diffInMonths',\n week: 'diffInWeeks',\n day: 'diffInDays',\n hour: 'diffInHours',\n minute: 'diffInMinutes',\n second: 'diffInSeconds',\n};\n\nexport const thresholds = {\n month: 12,\n week: null,\n day: 7,\n hour: 24,\n minute: 60,\n second: 60,\n};\n","import { getDateFormatter } from './factory.js';\nimport { diffMethods, thresholds } from './vars.js';\n\n/** @typedef {import('./date-time.js').default} DateTime */\n\n/**\n * DateTime Helpers\n */\n\n/**\n * Escapes a string for safe use inside a RegExp source.\n * @param {string} value The string to escape.\n * @returns {string} The escaped string.\n */\nfunction escapeRegExp(value) {\n return value.replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&');\n}\n\n/**\n * Gets a stable day number from a DateTime's local calendar fields.\n * @param {DateTime} date The DateTime.\n * @returns {number} The local calendar day number.\n */\nfunction calendarDay(date) {\n const calendarDate = new Date(0);\n calendarDate.setUTCFullYear(date.getYear(), date.getMonth() - 1, date.getDate());\n\n return calendarDate.getTime() / 86400000;\n}\n\n/**\n * Calculates the difference between two dates in a given time unit.\n * @param {DateTime} date The base DateTime.\n * @param {DateTime} other The DateTime to compare to.\n * @param {'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second'} timeUnit The time unit to compare in.\n * @param {boolean} [relative=true] Whether to use relative boundaries when calculating the difference.\n * @returns {number} The difference between the dates in the given time unit.\n */\nexport function calculateDiff(date, other, timeUnit, relative = true) {\n other = other.withTimeZone(date.getTimeZone());\n\n switch (timeUnit) {\n case 'year':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n ),\n date.getYear() - other.getYear(),\n !relative,\n -1,\n );\n case 'month':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n ),\n (date.getYear() - other.getYear()) * 12 + date.getMonth() - other.getMonth(),\n !relative,\n -1,\n );\n case 'week':\n if (relative) {\n const dateWeek = date.startOfWeek();\n const otherWeek = other.withLocale(date.getLocale()).startOfWeek();\n\n return (\n calendarDay(dateWeek) -\n calendarDay(otherWeek)\n ) / 7;\n }\n\n return compensateDiff(\n date,\n other.withWeekYear(\n date.getWeekYear(),\n date.getWeek(),\n ),\n (date - other) / 604800000,\n relative,\n );\n case 'day':\n if (relative) {\n return calendarDay(date) - calendarDay(other);\n }\n\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ),\n (date - other) / 86400000,\n relative,\n );\n case 'hour':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ).withHours(\n date.getHours(),\n ),\n (date - other) / 3600000,\n relative,\n );\n case 'minute':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ).withHours(\n date.getHours(),\n date.getMinutes(),\n ),\n (date - other) / 60000,\n relative,\n );\n case 'second':\n return compensateDiff(\n date,\n other.withYear(\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n ).withHours(\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ),\n (date - other) / 1000,\n relative,\n );\n default:\n throw new Error('Invalid time unit supplied');\n }\n};\n\n/**\n * Gets the RegExp for a list of string values.\n * Longer values are matched first to avoid prefix collisions.\n * @param {string[]} values The values to include in the RegExp.\n * @returns {string} The values RegExp.\n */\nexport function valuesRegExp(values) {\n return values.slice()\n .sort((a, b) => b.length - a.length)\n .map((value) => escapeRegExp(`${value}`))\n .join('|');\n};\n\n/**\n * Compensates the difference between two dates.\n * @param {DateTime} date The DateTime.\n * @param {DateTime} other The DateTime to compare to.\n * @param {number} amount The amount to compensate.\n * @param {boolean} [compensate=true] Whether to compensate the amount.\n * @param {number} [compensation=1] The compensation offset.\n * @returns {number} The compensated amount.\n */\nfunction compensateDiff(date, other, amount, compensate = true, compensation = 1) {\n if (amount > 0) {\n amount = Math.floor(amount);\n\n if (compensate && date < other) {\n amount += compensation;\n }\n } else if (amount < 0) {\n amount = Math.ceil(amount);\n\n if (compensate && date > other) {\n amount -= compensation;\n }\n }\n\n return amount;\n};\n\n/**\n * Gets the biggest difference between two dates.\n * @param {DateTime} date The DateTime.\n * @param {DateTime} [other] The DateTime to compare to.\n * @returns {[number, string]} The biggest difference (amount and time unit).\n */\nexport function getBiggestDiff(date, other) {\n let lastResult;\n for (const [timeUnit, diffMethod] of Object.entries(diffMethods)) {\n const relativeDiff = date[diffMethod](other);\n\n if (lastResult && thresholds[timeUnit] && Math.abs(relativeDiff) >= thresholds[timeUnit]) {\n return lastResult;\n }\n\n const actualDiff = date[diffMethod](other, { relative: false });\n\n if (actualDiff) {\n return [relativeDiff, timeUnit];\n }\n\n if (relativeDiff) {\n lastResult = [relativeDiff, timeUnit];\n } else {\n lastResult = null;\n }\n }\n\n return lastResult ?\n lastResult :\n [0, 'second'];\n};\n\n/**\n * Gets the offset for a DateTime.\n * @param {DateTime} date The DateTime.\n * @returns {number} The offset.\n */\nexport function getOffset(date) {\n const timeZone = date.getTimeZone();\n\n if (timeZone === 'UTC') {\n return 0;\n }\n\n const values = Object.fromEntries(\n getDateFormatter(timeZone)\n .formatToParts(date)\n .filter((part) => part.type !== 'literal')\n .map(({ type, value }) => [type, value]),\n );\n\n let year = parseInt(values.year, 10);\n if (values.era === 'BC') {\n year = 1 - year;\n }\n\n const localDate = new Date(0);\n localDate.setUTCFullYear(\n year,\n parseInt(values.month, 10) - 1,\n parseInt(values.day, 10),\n );\n const localTime = localDate.setUTCHours(\n parseInt(values.hour, 10),\n parseInt(values.minute, 10),\n parseInt(values.second, 10),\n parseInt(values.fractionalSecond, 10),\n );\n\n return (date.getTime() - localTime) / 60000;\n};\n\n/**\n * Gets the number of milliseconds since the UNIX epoch (offset to timeZone).\n * @param {DateTime} date The DateTime.\n * @returns {number} The number of milliseconds since the UNIX epoch (offset to timeZone).\n */\nexport function getOffsetTime(date) {\n return date.getTime() - (date.getTimeZoneOffset() * 60000);\n};\n\n/**\n * Compares a literal format string with a date string.\n * @param {string} formatString The literal format string.\n * @param {string} dateString The date string.\n */\nexport function parseCompare(formatString, dateString) {\n let i = 0;\n for (const char of formatString) {\n if (char !== dateString[i]) {\n throw new Error(`Unmatched character in DateTime string: ${char}`);\n }\n\n i++;\n }\n};\n\n/**\n * Parses a supported unzoned ISO string as a neutral wall-clock timestamp.\n * @param {string} dateString The date string to parse.\n * @returns {number|null} The timestamp, or null if the shape is not supported.\n */\nexport function parseLocalTimestamp(dateString) {\n const match =\n dateString.match(/^(\\d{4})(?:-(\\d{2})(?:-(\\d{2}))?)?$/) ||\n dateString.match(/^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?$/);\n\n if (!match) {\n return null;\n }\n\n const [\n , year,\n month = 1,\n day = 1,\n hours = 0,\n minutes = 0,\n seconds = 0,\n fraction = '',\n ] = match;\n const date = new Date(0);\n\n date.setUTCFullYear(year, month - 1, day);\n date.setUTCHours(hours, minutes, seconds, fraction.padEnd(3, '0').substring(0, 3));\n\n return date.getTime();\n};\n\n/**\n * Generates methods for parsing a date.\n * @returns {Record<string, {get: Function, set: Function}>} An object containing date parsing methods.\n */\nexport function parseFactory() {\n let isPM = false;\n let lastAM = true;\n\n return {\n date: {\n get: (datetime) => datetime.getDate(),\n set: (datetime, value) => datetime.withDate(value),\n },\n dayPeriod: {\n get: (datetime) => datetime.getHours() < 12 ? 0 : 1,\n set: (datetime, value) => {\n isPM = value;\n let hours = value ? 12 : 0;\n if (lastAM) {\n hours += datetime.getHours();\n }\n return datetime.withHours(hours);\n },\n },\n dayOfYear: {\n get: (datetime) => datetime.getDayOfYear(),\n set: (datetime, value) => datetime.withDayOfYear(value),\n },\n era: {\n get: (datetime) => datetime.getYear() < 0 ? 0 : 1,\n set: (datetime, value) => {\n const offset = value ? 1 : -1;\n return datetime.withYear(\n datetime.getYear() * offset,\n );\n },\n },\n hours12: {\n get: (datetime) => datetime.getHours() % 12,\n set: (datetime, value) => {\n if (isPM) {\n value += 12;\n }\n lastAM = true;\n return datetime.withHours(value);\n },\n },\n hours24: {\n get: (datetime) => datetime.getHours(),\n set: (datetime, value) => {\n lastAM = false;\n return datetime.withHours(value);\n },\n },\n milliseconds: {\n get: (datetime) => datetime.getMilliseconds(),\n set: (datetime, value) => datetime.withMilliseconds(value),\n },\n minutes: {\n get: (datetime) => datetime.getMinutes(),\n set: (datetime, value) => datetime.withMinutes(value),\n },\n month: {\n get: (datetime) => datetime.getMonth(),\n set: (datetime, value) => datetime.withMonth(value),\n },\n quarter: {\n get: (datetime) => datetime.getQuarter(),\n set: (datetime, value) => datetime.withQuarter(value),\n },\n seconds: {\n get: (datetime) => datetime.getSeconds(),\n set: (datetime, value) => datetime.withSeconds(value),\n },\n week: {\n get: (datetime) => datetime.getWeek(),\n set: (datetime, value) => datetime.withWeek(value),\n },\n weekDay: {\n get: (datetime) => datetime.getWeekDay(),\n set: (datetime, value) => datetime.withWeekDay(value),\n },\n weekDayInMonth: {\n get: (datetime) => datetime.getWeekDayInMonth(),\n set: (datetime, value) => datetime.withWeekDayInMonth(value),\n },\n weekOfMonth: {\n get: (datetime) => datetime.getWeekOfMonth(),\n set: (datetime, value) => datetime.withWeekOfMonth(value),\n },\n weekYear: {\n get: (datetime) => datetime.getWeekYear(),\n set: (datetime, value) => datetime.withWeekYear(value),\n },\n year: {\n get: (datetime) => {\n const year = datetime.getYear();\n return Math.abs(year);\n },\n set: (datetime, value) => datetime.withYear(value),\n },\n };\n};\n\n/**\n * Sets the number of milliseconds since the UNIX epoch (offset to timeZone).\n * @param {DateTime} date The DateTime.\n * @param {number} time The number of milliseconds since the UNIX epoch (offset to timeZone).\n * @param {number} [direction=1] The direction to resolve a gap.\n * @returns {DateTime} A new DateTime instance.\n */\nexport function setOffsetTime(date, time, direction = 1) {\n const newDate = date.withTime(\n time + (date.getTimeZoneOffset() * 60000),\n );\n const newOffsetTime = getOffsetTime(newDate);\n\n if (newOffsetTime === time) {\n return newDate;\n }\n\n const adjustedDate = date.withTime(\n time + (newDate.getTimeZoneOffset() * 60000),\n );\n const adjustedOffsetTime = getOffsetTime(adjustedDate);\n\n if (adjustedOffsetTime === time) {\n return adjustedDate;\n }\n\n if (direction < 0) {\n return newOffsetTime < adjustedOffsetTime ?\n newDate :\n adjustedDate;\n }\n\n return newOffsetTime > adjustedOffsetTime ?\n newDate :\n adjustedDate;\n};\n","import { getData, makeFormatter } from './../factory.js';\nimport { valuesRegExp } from './../helpers.js';\n\n/**\n * Formatter value caches.\n */\n\n/**\n * Gets cached localized day-period labels.\n * @param {string} locale The locale.\n * @param {string} [type='long'] The formatting type.\n * @returns {string[]} The localized day-period labels.\n */\nexport function getDayPeriods(locale, type = 'long') {\n return getData(\n `periods.${locale}.${type}`,\n () => {\n const dayPeriodFormatter = makeFormatter(locale, { hour: 'numeric', hourCycle: 'h11' });\n return new Array(2)\n .fill()\n .map((_, index) =>\n dayPeriodFormatter.formatToParts(Date.UTC(2018, 0, 1, index * 12))\n .find((part) => part.type === 'dayPeriod')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized weekday labels.\n * @param {string} locale The locale.\n * @param {string} [type='long'] The formatting type.\n * @param {boolean} [standalone=true] Whether the values are standalone.\n * @returns {string[]} The localized weekday labels.\n */\nexport function getDays(locale, type = 'long', standalone = true) {\n return getData(\n `days.${locale}.${type}.${standalone}`,\n () => {\n if (standalone) {\n const dayFormatter = makeFormatter(locale, { weekday: type });\n return new Array(7)\n .fill()\n .map((_, index) =>\n dayFormatter.format(Date.UTC(2018, 0, index)),\n );\n }\n\n const dayFormatter = makeFormatter(locale, { year: 'numeric', month: 'numeric', day: 'numeric', weekday: type });\n return new Array(7)\n .fill()\n .map((_, index) =>\n dayFormatter.formatToParts(Date.UTC(2018, 0, index))\n .find((part) => part.type === 'weekday')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized era labels.\n * @param {string} locale The locale.\n * @param {string} [type='long'] The formatting type.\n * @returns {string[]} The localized era labels.\n */\nexport function getEras(locale, type = 'long') {\n return getData(\n `eras.${locale}.${type}`,\n () => {\n const eraFormatter = makeFormatter(locale, { era: type });\n return new Array(2)\n .fill()\n .map((_, index) =>\n eraFormatter.formatToParts(Date.UTC(index - 1, 0, 1))\n .find((part) => part.type === 'era')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized month labels.\n * @param {string} locale The locale.\n * @param {string} [type='long'] The formatting type.\n * @param {boolean} [standalone=true] Whether the values are standalone.\n * @returns {string[]} The localized month labels.\n */\nexport function getMonths(locale, type = 'long', standalone = true) {\n return getData(\n `months.${locale}.${type}.${standalone}`,\n () => {\n if (standalone) {\n const monthFormatter = makeFormatter(locale, { month: type });\n return new Array(12)\n .fill()\n .map((_, index) =>\n monthFormatter.format(Date.UTC(2018, index, 1)),\n );\n }\n\n const monthFormatter = makeFormatter(locale, { year: 'numeric', month: type, day: 'numeric' });\n return new Array(12)\n .fill()\n .map((_, index) =>\n monthFormatter.formatToParts(Date.UTC(2018, index, 1))\n .find((part) => part.type === 'month')\n .value,\n );\n },\n );\n};\n\n/**\n * Gets cached localized digit glyphs.\n * @param {string} locale The locale.\n * @returns {string[]} The localized digit glyphs.\n */\nexport function getNumbers(locale) {\n return getData(\n `numbers.${locale}`,\n () => {\n const numberFormatter = makeFormatter(locale, { minute: 'numeric' });\n return new Array(10)\n .fill()\n .map((_, index) =>\n numberFormatter.format(Date.UTC(2018, 0, 1, 0, index)),\n );\n },\n );\n};\n\n/**\n * Gets the RegExp for the number values.\n * @param {string} locale The locale.\n * @param {number|null} [length=null] The exact number of digits to match.\n * @returns {string} The number values RegExp.\n */\nexport function numberRegExp(locale, length = null) {\n const quantifier = length === null ?\n '+' :\n `{${length}}`;\n return `(?:${valuesRegExp(getNumbers(locale))})${quantifier}`;\n};\n","import { getRelativeFormatter, makeFormatter } from './../factory.js';\nimport { getDayPeriods, getDays, getEras, getMonths, getNumbers } from './values.js';\n\n/**\n * Formats a day as a locale string.\n * @param {string} locale The locale.\n * @param {number} day The day to format (0-6).\n * @param {string} [type='long'] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @returns {string} The formatted string.\n */\nexport function formatDay(locale, day, type = 'long', standalone = true) {\n return getDays(locale, type, standalone)[day];\n};\n\n/**\n * Formats a day period as a locale string.\n * @param {string} locale The locale.\n * @param {number} period The day-period index to format. (0-1)\n * @param {string} [type='long'] The formatting type.\n * @returns {string} The formatted string.\n */\nexport function formatDayPeriod(locale, period, type = 'long') {\n return getDayPeriods(locale, type)[period];\n};\n\n/**\n * Formats an era as a locale string.\n * @param {string} locale The locale.\n * @param {number} era The era index to format. (0-1)\n * @param {string} [type='long'] The formatting type.\n * @returns {string} The formatted string.\n */\nexport function formatEra(locale, era, type = 'long') {\n return getEras(locale, type)[era];\n};\n\n/**\n * Formats a month as a locale string.\n * @param {string} locale The locale.\n * @param {number} month The month to format (1-12).\n * @param {string} [type='long'] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @returns {string} The formatted string.\n */\nexport function formatMonth(locale, month, type = 'long', standalone = true) {\n return getMonths(locale, type, standalone)[month - 1];\n};\n\n/**\n * Formats a number as a locale number string.\n * @param {string} locale The locale.\n * @param {number} number The number to format.\n * @param {number} [padding=0] The amount of padding to use.\n * @returns {string} The formatted string.\n */\nexport function formatNumber(locale, number, padding = 0) {\n const numbers = getNumbers(locale);\n return `${number}`\n .padStart(padding, '0')\n .replace(/\\d/g, (match) => numbers[match]);\n};\n\n/**\n * Formats a number to an offset string.\n * @param {number} offset The offset to format.\n * @param {boolean} [useColon=true] Whether to use a colon separator.\n * @param {boolean} [optionalMinutes=false] Whether minutes are optional.\n * @param {boolean} [includeSeconds=true] Whether seconds are included.\n * @returns {string} The formatted offset string.\n */\nexport function formatOffset(offset, useColon = true, optionalMinutes = false, includeSeconds = true) {\n const absoluteSeconds = Math.abs(offset * 60);\n const totalSeconds = Math.round(absoluteSeconds);\n const precision = Number.EPSILON * Math.max(1, absoluteSeconds);\n const roundingError = Math.abs(absoluteSeconds - totalSeconds);\n if (!Number.isFinite(absoluteSeconds) || roundingError > precision || totalSeconds >= 86400) {\n throw new Error('Invalid time zone offset supplied');\n }\n\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor(totalSeconds % 3600 / 60);\n const seconds = totalSeconds % 60;\n const sign = offset > 0 ?\n '-' :\n '+';\n const parts = [`${hours}`.padStart(2, '0')];\n\n if (!optionalMinutes || minutes || seconds) {\n parts.push(`${minutes}`.padStart(2, '0'));\n }\n\n if (includeSeconds && seconds) {\n parts.push(`${seconds}`.padStart(2, '0'));\n }\n\n return sign + parts.join(useColon ? ':' : '');\n};\n\n/**\n * Formats a relative duration as a locale string.\n * @param {string} locale The locale.\n * @param {number} amount The amount of duration.\n * @param {string} unit The time unit.\n * @returns {string} The relative duration.\n */\nexport function formatRelative(locale, amount, unit) {\n const relativeFormatter = getRelativeFormatter(locale);\n\n if (!relativeFormatter) {\n throw new Error('RelativeTimeFormat not supported');\n }\n\n return relativeFormatter.format(amount, unit);\n};\n\n/**\n * Formats a time zone as a locale string.\n * @param {string} locale The locale.\n * @param {number} timestamp The timestamp to use.\n * @param {string} timeZone The time zone to format.\n * @param {string} [type='long'] The formatting type.\n * @returns {string} The formatted string.\n */\nexport function formatTimeZoneName(locale, timestamp, timeZone, type = 'long') {\n return makeFormatter(locale, { second: 'numeric', timeZone, timeZoneName: type })\n .formatToParts(timestamp)\n .find((part) => part.type === 'timeZoneName')\n .value;\n};\n","export const weekStart = { '1': ['af', 'am', 'ar-il', 'ar-sa', 'ar-ye', 'as', 'bn', 'bo', 'brx', 'ccp', 'ceb', 'chr', 'dav', 'doi', 'dz', 'ebu', 'en', 'es-br', 'es-bz', 'es-co', 'es-do', 'es-gt', 'es-hn', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-ph', 'es-pr', 'es-py', 'es-sv', 'es-us', 'es-ve', 'fil', 'fr-ca', 'gu', 'guz', 'haw', 'he', 'hi', 'id', 'ii', 'ja', 'jv', 'kam', 'ki', 'kln', 'km', 'kn', 'ko', 'kok', 'ks', 'lkt', 'lo', 'luo', 'luy', 'mai', 'mas', 'mer', 'mgh', 'ml', 'mni', 'mr', 'ms-id', 'ms-sg', 'mt', 'my', 'nd', 'ne', 'om', 'or', 'pa', 'ps-pk', 'pt', 'qu', 'sa', 'saq', 'sat', 'sd', 'seh', 'sn', 'so-et', 'so-ke', 'su', 'sw-ke', 'ta', 'te', 'teo-ke', 'th', 'ti', 'ug', 'ur', 'xh', 'yue', 'zh', 'zu'], '2': ['af-na', 'ar-001', 'ar-eh', 'ar-er', 'ar-km', 'ar-lb', 'ar-ma', 'ar-mr', 'ar-ps', 'ar-so', 'ar-ss', 'ar-td', 'ar-tn', 'en-001', 'en-150', 'en-ai', 'en-at', 'en-au', 'en-bb', 'en-be', 'en-bi', 'en-bm', 'en-cc', 'en-ch', 'en-ck', 'en-cm', 'en-cx', 'en-cy', 'en-de', 'en-dg', 'en-dk', 'en-er', 'en-fi', 'en-fj', 'en-fk', 'en-fm', 'en-gb', 'en-gd', 'en-gg', 'en-gh', 'en-gi', 'en-gm', 'en-gy', 'en-ie', 'en-im', 'en-io', 'en-je', 'en-ki', 'en-kn', 'en-ky', 'en-lc', 'en-lr', 'en-ls', 'en-mg', 'en-mp', 'en-ms', 'en-mu', 'en-mw', 'en-my', 'en-na', 'en-nf', 'en-ng', 'en-nl', 'en-nr', 'en-nu', 'en-nz', 'en-pg', 'en-pn', 'en-pw', 'en-rw', 'en-sb', 'en-sc', 'en-se', 'en-sh', 'en-si', 'en-sl', 'en-ss', 'en-sx', 'en-sz', 'en-tc', 'en-tk', 'en-to', 'en-tv', 'en-tz', 'en-ug', 'en-vc', 'en-vg', 'en-vu', 'en-zm', 'ko-kp', 'mas-tz', 'pt-ao', 'pt-ch', 'pt-cv', 'pt-gq', 'pt-gw', 'pt-lu', 'pt-st', 'pt-tl', 'qu-bo', 'qu-ec', 'ta-lk', 'ta-my', 'ti-er'], '7': ['ar', 'ckb', 'en-ae', 'en-sd', 'fa', 'fr-dj', 'fr-dz', 'fr-sy', 'kab', 'lrc', 'mzn', 'ps', 'so-dj', 'uz-arab', 'uz-arab-af'] };\nexport const minDaysInFirstWeek = { '4': ['ast', 'bg', 'br', 'ca', 'ce', 'cs', 'cy', 'da', 'de', 'dsb', 'el', 'en-at', 'en-be', 'en-ch', 'en-de', 'en-dk', 'en-fi', 'en-fj', 'en-gb', 'en-gg', 'en-gi', 'en-ie', 'en-im', 'en-je', 'en-nl', 'en-se', 'es', 'et', 'eu', 'fi', 'fo', 'fr', 'fur', 'fy', 'ga', 'gd', 'gl', 'gsw', 'gv', 'hsb', 'hu', 'is', 'it', 'ksh', 'kw', 'lb', 'lt', 'nb', 'nl', 'nn', 'no', 'os-ru', 'pl', 'pt-ch', 'pt-lu', 'pt-pt', 'rm', 'ru', 'sah', 'sc', 'se', 'sk', 'smn', 'sv', 'tt', 'wae'], '1': ['da-gl', 'el-cy', 'es-419', 'es-ar', 'es-bo', 'es-br', 'es-bz', 'es-cl', 'es-co', 'es-cr', 'es-cu', 'es-do', 'es-ea', 'es-ec', 'es-gq', 'es-gt', 'es-hn', 'es-ic', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-ph', 'es-pr', 'es-py', 'es-sv', 'es-us', 'es-uy', 'es-ve', 'fr-bf', 'fr-bi', 'fr-bj', 'fr-bl', 'fr-ca', 'fr-cd', 'fr-cf', 'fr-cg', 'fr-ci', 'fr-cm', 'fr-dj', 'fr-dz', 'fr-ga', 'fr-gn', 'fr-gq', 'fr-ht', 'fr-km', 'fr-ma', 'fr-mf', 'fr-mg', 'fr-ml', 'fr-mr', 'fr-mu', 'fr-nc', 'fr-ne', 'fr-pf', 'fr-pm', 'fr-rw', 'fr-sc', 'fr-sn', 'fr-sy', 'fr-td', 'fr-tg', 'fr-tn', 'fr-vu', 'fr-wf', 'fr-yt', 'nl-aw', 'nl-bq', 'nl-cw', 'nl-sr', 'nl-sx', 'ru-by', 'ru-kg', 'ru-kz', 'ru-md', 'ru-ua'] };\n","import { getData } from './../factory.js';\nimport { minDaysInFirstWeek, weekStart } from './locales.js';\n\n/**\n * Gets a locale value from generated data.\n * @param {object} data The generated locale data.\n * @param {string[]} candidates The locale candidates.\n * @param {number} fallback The fallback value.\n * @returns {number} The locale value.\n */\nfunction generatedValue(data, candidates, fallback) {\n for (const candidate of candidates) {\n for (const [value, valueLocales] of Object.entries(data)) {\n if (valueLocales.includes(candidate)) {\n return parseInt(value, 10);\n }\n }\n }\n\n return fallback;\n}\n\n/**\n * Gets generated-data candidates for a locale.\n * @param {Intl.Locale} locale The locale.\n * @returns {string[]} The locale candidates.\n */\nfunction localeCandidates(locale) {\n const localeName = locale.toString().split('-x-', 1)[0];\n const regionOverride = localeName.match(\n /-u-(?:[a-z0-9]{2,8}-)*rg-([a-z]{2}|\\d{3})zzzz(?:-|$)/i,\n );\n const region = regionOverride?.[1] || locale.region;\n\n return [\n [locale.language, locale.script, region],\n [locale.language, region],\n [locale.language, locale.script],\n [locale.language],\n ].map((parts) =>\n parts\n .filter((part) => !!part)\n .join('-')\n .toLowerCase(),\n );\n}\n\n/**\n * Gets week information for a locale.\n * @param {string} locale The locale.\n * @returns {{firstDay: number, minimalDays: number}} The week information.\n */\nexport function getWeekInfo(locale) {\n return getData(\n `weekInfo.${locale}`,\n () => {\n const localeData = new Intl.Locale(locale);\n const runtimeInfo = localeData.getWeekInfo?.() || localeData.weekInfo || {};\n\n let { firstDay = null, minimalDays = null } = runtimeInfo;\n\n const candidates = firstDay && minimalDays ?\n [] :\n localeCandidates(localeData);\n\n if (!firstDay) {\n const phpFirstDay = generatedValue(weekStart, candidates, 2);\n\n // IntlCalendar numbers Sunday as 1; Intl.Locale numbers it as 7.\n firstDay = phpFirstDay === 1 ? 7 : phpFirstDay - 1;\n }\n\n if (!minimalDays) {\n minimalDays = generatedValue(minDaysInFirstWeek, candidates, 1);\n }\n\n return { firstDay, minimalDays };\n },\n );\n};\n","import { getWeekInfo } from './locale.js';\nimport { numberRegExp } from './values.js';\n\n/**\n * Decodes a quoted ICU format literal.\n * @param {string} literal The literal to decode.\n * @returns {string} The decoded literal.\n */\nexport function decodeLiteral(literal) {\n return literal === `''` ?\n `'` :\n literal.slice(1, -1).replace(/''/g, `'`);\n};\n\n/**\n * Gets the formatting type from the component token length.\n * @param {number} length The component token length.\n * @returns {string} The formatting type.\n */\nexport function getType(length) {\n switch (length) {\n case 5:\n return 'narrow';\n case 4:\n return 'long';\n default:\n return 'short';\n }\n};\n\n/**\n * Gets the parsing RegExp data for a format token.\n * @param {string} source The token RegExp.\n * @param {string|null} nextSource The next token RegExp.\n * @param {number} length The token length.\n * @param {string} locale The parsing locale.\n * @param {boolean} previousNumeric Whether the previous token was an adjacent numeric token.\n * @returns {{numeric: boolean, source: string}} The token RegExp data.\n */\nexport function getTokenRegExp(source, nextSource, length, locale, previousNumeric) {\n const numberSource = numberRegExp(locale);\n let numeric = true;\n\n if (source !== numberSource) {\n numeric = false;\n } else if (previousNumeric || nextSource === numberSource) {\n source = numberRegExp(locale, length);\n }\n\n return { numeric, source };\n};\n\n/**\n * Gets the locale's minimum days in the first week of the year.\n * @param {string} locale The locale.\n * @returns {number} The minimum day count.\n */\nexport function minimumDays(locale) {\n return getWeekInfo(locale).minimalDays;\n};\n\n/**\n * Converts a Sunday-based day-of-week value to the locale's week numbering.\n * @param {string} locale The locale.\n * @param {number} day The day of the week. (0 = Sunday, 6 = Saturday)\n * @returns {number} The local day of the week.\n */\nexport function weekDay(locale, day) {\n return (7 + parseInt(day, 10) - (getWeekInfo(locale).firstDay % 7)) % 7 + 1;\n};\n","import { weekDay } from './utility.js';\nimport { getDayPeriods, getDays, getEras, getMonths, getNumbers } from './values.js';\n\n/**\n * Parses a day from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type='long'] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @returns {number} The local day of the week (1-7).\n */\nexport function parseDay(locale, value, type = 'long', standalone = true) {\n const day = getDays(locale, type, standalone).indexOf(value);\n if (day === -1) {\n throw new Error(`Unmatched day string in DateTime string: ${value}`);\n }\n return weekDay(locale, day);\n};\n\n/**\n * Parses a day period from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type='long'] The formatting type.\n * @returns {number} The day period (0-1).\n */\nexport function parseDayPeriod(locale, value, type = 'long') {\n return getDayPeriods(locale, type).indexOf(value);\n};\n\n/**\n * Parses an era from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type='long'] The formatting type.\n * @returns {number} The era (0-1).\n */\nexport function parseEra(locale, value, type = 'long') {\n return getEras(locale, type).indexOf(value);\n};\n\n/**\n * Parses a month from a locale string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @param {string} [type='long'] The formatting type.\n * @param {boolean} [standalone=true] Whether the value is standalone.\n * @returns {number} The month number (1-12).\n */\nexport function parseMonth(locale, value, type = 'long', standalone = true) {\n return getMonths(locale, type, standalone).indexOf(value) + 1;\n};\n\n/**\n * Parses locale digits into an ASCII digit string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @returns {string} The parsed ASCII digit string.\n */\nexport function parseNumberString(locale, value) {\n const numbers = getNumbers(locale);\n return Array.from(value, (digit) => numbers.indexOf(digit)).join('');\n};\n\n/**\n * Parses a number from a locale number string.\n * @param {string} locale The locale.\n * @param {string} value The value to parse.\n * @returns {number} The parsed number.\n */\nexport function parseNumber(locale, value) {\n return parseInt(\n parseNumberString(locale, value),\n 10,\n );\n};\n","import { valuesRegExp } from './../helpers.js';\nimport { formatDay, formatMonth, formatNumber, formatOffset } from './format.js';\nimport { parseDay, parseDayPeriod, parseEra, parseMonth, parseNumber, parseNumberString } from './parse.js';\nimport { getType } from './utility.js';\nimport { getDayPeriods, getDays, getEras, getMonths, numberRegExp } from './values.js';\n\n/**\n * DateFormatter Format Data\n */\n\nexport default {\n\n /* ERA */\n\n G: {\n key: 'era',\n regex: (locale, length) => {\n const type = getType(length);\n return valuesRegExp(getEras(locale, type));\n },\n input: (locale, value, length) => {\n const type = getType(length);\n return parseEra(locale, value, type);\n },\n output: (datetime, length) => {\n const type = getType(length);\n return datetime.era(type);\n },\n },\n\n /* YEAR */\n\n // year\n y: {\n key: 'year',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value, length) => {\n value = parseNumber(locale, value);\n\n if (length !== 2 || `${value}`.length !== 2) {\n return value;\n }\n\n return value > 40 ?\n 1900 + value :\n 2000 + value;\n },\n output: (datetime, length) => {\n let year = datetime.getYear();\n if (length === 2) {\n year = `${year}`.slice(-2);\n }\n return formatNumber(\n datetime.getLocale(),\n Math.abs(year),\n length,\n );\n },\n },\n\n // week year\n Y: {\n key: 'weekYear',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value, length) => {\n value = parseNumber(locale, value);\n\n if (length !== 2 || `${value}`.length !== 2) {\n return value;\n }\n\n return value > 40 ?\n 1900 + value :\n 2000 + value;\n },\n output: (datetime, length) => {\n let year = datetime.getWeekYear();\n if (length === 2) {\n year = `${year}`.slice(-2);\n }\n return formatNumber(\n datetime.getLocale(),\n Math.abs(year),\n length,\n );\n },\n },\n\n /* QUARTER */\n\n // quarter\n Q: {\n key: 'quarter',\n supportsLength: (length) => length !== 3 && length !== 4,\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getQuarter(),\n length < 3 ? length : 0,\n ),\n },\n\n // quarter (standalone)\n q: {\n key: 'quarter',\n supportsLength: (length) => length !== 3 && length !== 4,\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getQuarter(),\n length < 3 ? length : 0,\n ),\n },\n\n /* MONTH */\n\n // month\n M: {\n key: 'month',\n supportsLength: (length, parsing) => !parsing || length !== 5,\n regex: (locale, length) => {\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return valuesRegExp(getMonths(locale, type, false));\n }\n default:\n return numberRegExp(locale);\n }\n },\n input: (locale, value, length) => {\n switch (length) {\n case 4:\n case 3: {\n const type = getType(length);\n return parseMonth(locale, value, type, false);\n }\n default:\n return parseNumber(locale, value);\n }\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n const month = datetime.getMonth();\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return formatMonth(locale, month, type, false);\n }\n default:\n return formatNumber(locale, month, length);\n }\n },\n },\n\n // month (standalone)\n L: {\n key: 'month',\n supportsLength: (length, parsing) => !parsing || length !== 5,\n regex: (locale, length) => {\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return valuesRegExp(getMonths(locale, type));\n }\n default:\n return numberRegExp(locale);\n }\n },\n input: (locale, value, length) => {\n switch (length) {\n case 4:\n case 3: {\n const type = getType(length);\n return parseMonth(locale, value, type);\n }\n default:\n return parseNumber(locale, value);\n }\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n const month = datetime.getMonth();\n switch (length) {\n case 5:\n case 4:\n case 3: {\n const type = getType(length);\n return formatMonth(locale, month, type);\n }\n default:\n return formatNumber(locale, month, length);\n }\n },\n },\n\n /* WEEK */\n\n // local week\n w: {\n key: 'week',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getWeek(),\n length,\n ),\n },\n\n // local week of month\n W: {\n key: 'weekOfMonth',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getWeekOfMonth(),\n length,\n ),\n },\n\n /* DAY */\n\n // day of month\n d: {\n key: 'date',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getDate(),\n length,\n ),\n },\n\n // day of year\n D: {\n key: 'dayOfYear',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getDayOfYear(),\n length,\n ),\n },\n\n // day of week in month\n F: {\n key: 'weekDayInMonth',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getWeekDayInMonth(),\n length,\n ),\n },\n\n // week day name\n E: {\n key: 'weekDay',\n supportsLength: (length, parsing) =>\n length !== 6 && (!parsing || length !== 5),\n regex: (locale, length) => {\n const type = getType(length);\n return valuesRegExp(getDays(locale, type, false));\n },\n input: (locale, value, length) => {\n const type = getType(length);\n return parseDay(locale, value, type, false);\n },\n output: (datetime, length) => {\n const type = getType(length);\n const locale = datetime.getLocale();\n const day = datetime.getDay();\n return formatDay(locale, day, type, false);\n },\n },\n\n // week day\n e: {\n key: 'weekDay',\n supportsLength: (length, parsing) =>\n length !== 6 && (!parsing || length !== 5),\n regex: (locale, length) => {\n if (length < 3) {\n return numberRegExp(locale);\n }\n\n const type = getType(length);\n return valuesRegExp(getDays(locale, type, false));\n },\n input: (locale, value, length) => {\n if (length < 3) {\n return parseNumber(locale, value);\n }\n\n const type = getType(length);\n return parseDay(locale, value, type, false);\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n if (length < 3) {\n return formatNumber(locale, datetime.getWeekDay(), length);\n }\n\n const type = getType(length);\n return formatDay(locale, datetime.getDay(), type, false);\n },\n },\n\n // week day (standalone)\n c: {\n key: 'weekDay',\n supportsLength: (length, parsing) =>\n length !== 6 && (!parsing || length !== 5),\n regex: (locale, length) => {\n if (length < 3) {\n return numberRegExp(locale);\n }\n\n const type = getType(length);\n return valuesRegExp(getDays(locale, type));\n },\n input: (locale, value, length) => {\n if (length < 3) {\n return parseNumber(locale, value);\n }\n\n const type = getType(length);\n return parseDay(locale, value, type);\n },\n output: (datetime, length) => {\n const locale = datetime.getLocale();\n if (length < 3) {\n return formatNumber(locale, datetime.getWeekDay());\n }\n\n const type = getType(length);\n return formatDay(locale, datetime.getDay(), type);\n },\n },\n\n /* PERIOD */\n\n a: {\n key: 'dayPeriod',\n supportsLength: (length) => length <= 4,\n regex: (locale, length) => {\n const type = getType(length);\n return valuesRegExp(getDayPeriods(locale, type));\n },\n input: (locale, value, length) => {\n const type = getType(length);\n return parseDayPeriod(locale, value, type);\n },\n output: (datetime, length) => {\n const type = getType(length);\n return datetime.dayPeriod(type);\n },\n },\n\n /* HOUR */\n\n h: {\n key: 'hours12',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => {\n value = parseNumber(locale, value);\n if (value === 12) {\n value = 0;\n }\n return value;\n },\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours() % 12 || 12,\n length,\n ),\n },\n\n H: {\n key: 'hours24',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours(),\n length,\n ),\n },\n\n K: {\n key: 'hours12',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours() % 12,\n length,\n ),\n },\n\n k: {\n key: 'hours24',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => {\n value = parseNumber(locale, value);\n if (value === 24) {\n value = 0;\n }\n return value;\n },\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getHours() || 24,\n length,\n ),\n },\n\n /* MINUTE */\n\n m: {\n key: 'minutes',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getMinutes(),\n length,\n ),\n },\n\n /* SECOND */\n\n s: {\n key: 'seconds',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) => parseNumber(locale, value),\n output: (datetime, length) =>\n formatNumber(\n datetime.getLocale(),\n datetime.getSeconds(),\n length,\n ),\n },\n\n /* FRACTIONAL */\n\n S: {\n key: 'milliseconds',\n regex: (locale) => numberRegExp(locale),\n input: (locale, value) =>\n parseInt(\n parseNumberString(locale, value)\n .padEnd(3, '0')\n .slice(0, 3),\n 10,\n ),\n output: (datetime, length) => {\n const milliseconds = `${datetime.getMilliseconds()}`.padStart(3, '0');\n return formatNumber(\n datetime.getLocale(),\n milliseconds.padEnd(length, '0').slice(0, length),\n );\n },\n },\n\n /* TIMEZONE/OFFSET */\n\n z: {\n supportsLength: (_, parsing) => !parsing,\n output: (datetime, length) => {\n const type = getType(Math.min(length, 4));\n return datetime.timeZoneName(type);\n },\n },\n\n Z: {\n key: 'timeZone',\n regex: (_, length) => {\n if (length === 5) {\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}(?:\\\\:\\\\d{2})?|Z`;\n }\n\n return length >= 4 ?\n `GMT[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}|GMT` :\n `[\\\\+\\\\-]\\\\d{4}`;\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n const offset = datetime.getTimeZoneOffset();\n\n let useColon = true;\n let prefix = '';\n if (length === 5) {\n if (!offset) {\n return 'Z';\n }\n } else if (length >= 4) {\n prefix = 'GMT';\n\n if (!offset) {\n return prefix;\n }\n } else {\n useColon = false;\n }\n\n return prefix + formatOffset(offset, useColon, false, length === 5);\n },\n },\n\n O: {\n key: 'timeZone',\n supportsLength: (length) => length === 1 || length === 4,\n regex: (_, length) => {\n switch (length) {\n case 4:\n return `GMT[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}|GMT`;\n default:\n return `GMT[\\\\+\\\\-]\\\\d{2}|GMT`;\n }\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n const offset = datetime.getTimeZoneOffset();\n const prefix = 'GMT';\n\n if (!offset) {\n return prefix;\n }\n\n let optionalMinutes = false;\n switch (length) {\n case 4:\n break;\n default:\n optionalMinutes = true;\n }\n\n return prefix + formatOffset(offset, true, optionalMinutes);\n },\n },\n\n V: {\n key: 'timeZone',\n supportsLength: (length) => length === 2,\n regex: (_) => '([A-Za-z0-9_.+\\\\-/]+)',\n input: (_, value) => value,\n output: (datetime) => datetime.getTimeZone(),\n },\n\n X: {\n key: 'timeZone',\n supportsLength: (length) => length <= 5,\n regex: (_, length) => {\n switch (length) {\n case 5:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}(?:\\\\:\\\\d{2})?|Z`;\n case 4:\n return `[\\\\+\\\\-]\\\\d{4}(?:\\\\d{2})?|Z`;\n case 3:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}|Z`;\n case 2:\n return `[\\\\+\\\\-]\\\\d{4}|Z`;\n default:\n return `[\\\\+\\\\-]\\\\d{2}(?:\\\\d{2})?|Z`;\n }\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n const offset = datetime.getTimeZoneOffset();\n\n if (!offset) {\n return 'Z';\n }\n\n let useColon;\n switch (length) {\n case 5:\n case 3:\n useColon = true;\n break;\n default:\n useColon = false;\n break;\n }\n\n return formatOffset(offset, useColon, length === 1, length >= 4);\n },\n },\n\n x: {\n key: 'timeZone',\n supportsLength: (length) => length <= 5,\n regex: (_, length) => {\n switch (length) {\n case 5:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}(?:\\\\:\\\\d{2})?`;\n case 4:\n return `[\\\\+\\\\-]\\\\d{4}(?:\\\\d{2})?`;\n case 3:\n return `[\\\\+\\\\-]\\\\d{2}\\\\:\\\\d{2}`;\n case 2:\n return `[\\\\+\\\\-]\\\\d{4}`;\n default:\n return `[\\\\+\\\\-]\\\\d{2}(?:\\\\d{2})?`;\n }\n },\n input: (_, value) => value,\n output: (datetime, length) => {\n let useColon;\n switch (length) {\n case 5:\n case 3:\n useColon = true;\n break;\n default:\n useColon = false;\n break;\n }\n\n return formatOffset(datetime.getTimeZoneOffset(), useColon, length === 1, length >= 4);\n },\n },\n\n};\n","import { clearDataCache as clearFactoryDataCache } from './factory.js';\nimport {\n formatDay,\n formatDayPeriod,\n formatEra,\n formatMonth,\n formatOffset,\n formatRelative,\n formatTimeZoneName,\n} from './formatter/format.js';\nimport tokens from './formatter/tokens.js';\nimport { decodeLiteral, getTokenRegExp, minimumDays, weekDay } from './formatter/utility.js';\nimport {\n calculateDiff,\n getBiggestDiff,\n getOffset,\n getOffsetTime,\n parseCompare,\n parseFactory,\n parseLocalTimestamp,\n setOffsetTime,\n} from './helpers.js';\nimport {\n config,\n dateStringTimeZoneRegExp,\n formats,\n formatTokenRegExp,\n monthDays,\n offsetRegExp,\n parseOrderKeys,\n} from './vars.js';\n\n/**\n * @typedef {{timeZone?: string, locale?: string}} DateTimeOptions\n */\n\n/**\n * An immutable date and time object with locale-aware formatting and time-zone support.\n */\nexport default class DateTime {\n /**\n * Clears cached formatter and locale data.\n */\n static clearDataCache() {\n clearFactoryDataCache();\n }\n\n /**\n * Gets the day of the year for a year, month and date.\n * @param {number} year The year.\n * @param {number} month The month. (1-12)\n * @param {number} date The date.\n * @returns {number} The day of the year. (1-366)\n */\n static dayOfYear(year, month, date) {\n return new Array(month - 1)\n .fill()\n .reduce(\n (d, _, i) =>\n d + this.daysInMonth(year, i + 1),\n date,\n );\n }\n\n /**\n * Gets the number of days in a month for a given year.\n * @param {number} year The year.\n * @param {number} month The month. (1-12)\n * @returns {number} The number of days in the month.\n */\n static daysInMonth(year, month) {\n const date = new Date(0);\n date.setUTCFullYear(year, month - 1, 1);\n month = date.getUTCMonth();\n\n return monthDays[month] +\n (\n month === 1 && this.isLeapYear(\n date.getUTCFullYear(),\n ) ?\n 1 :\n 0\n );\n }\n\n /**\n * Gets the number of days in a given year.\n * @param {number} year The year.\n * @returns {number} The number of days in the year.\n */\n static daysInYear(year) {\n return !this.isLeapYear(year) ?\n 365 :\n 366;\n }\n\n /**\n * Creates a new DateTime from an array. Missing month/date values default to 1.\n * Missing time values default to 0.\n * @param {number[]} dateArray The date to parse.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @returns {DateTime} A new DateTime instance.\n */\n static fromArray(dateArray, options = {}) {\n const dateValues = dateArray.slice(0, 3);\n const timeValues = dateArray.slice(3);\n\n if (dateValues.length < 3) {\n dateValues.push(...new Array(3 - dateValues.length).fill(1));\n }\n\n if (timeValues.length < 4) {\n timeValues.push(...new Array(4 - timeValues.length).fill(0));\n }\n\n return new this(null, options)\n .withTimestamp(0)\n .withYear(...dateValues)\n .withHours(...timeValues);\n }\n\n /**\n * Creates a new DateTime from a Date.\n * @param {Date} date The date.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @returns {DateTime} A new DateTime instance.\n */\n static fromDate(date, options = {}) {\n return new this(date.getTime(), options);\n }\n\n /**\n * Creates a new DateTime from a format string.\n * @param {string} formatString The format string.\n * @param {string} dateString The date string.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @returns {DateTime} A new DateTime instance.\n * @throws {Error} When the format contains unsupported parsing tokens such as\n * `MMMMM` or `LLLLL`.\n */\n static fromFormat(formatString, dateString, options = {}) {\n const locale = 'locale' in options ?\n options.locale :\n config.defaultLocale;\n const requestedTimeZone = 'timeZone' in options ?\n options.timeZone :\n config.defaultTimeZone;\n\n const values = [];\n\n let match;\n let previousTokenNumeric = false;\n while (formatString && (match = formatString.match(formatTokenRegExp))) {\n const token = match[1];\n const position = match.index;\n const length = match[0].length;\n\n if (position) {\n const formatTest = formatString.substring(0, position);\n parseCompare(formatTest, dateString);\n }\n\n formatString = formatString.substring(position + length);\n dateString = dateString.substring(position);\n\n if (!token) {\n const literal = decodeLiteral(match[0]);\n parseCompare(literal, dateString);\n dateString = dateString.substring(literal.length);\n previousTokenNumeric = false;\n continue;\n }\n\n if (!(token in tokens)) {\n throw new Error(`Invalid token in DateTime format: ${token}`);\n }\n\n if (tokens[token].supportsLength?.(length, true) === false) {\n throw new Error(`Unsupported parsing token in DateTime format: ${token.repeat(length)}`);\n }\n\n const previousNumeric = previousTokenNumeric && !position;\n let nextSource = null;\n\n if (!previousNumeric) {\n const nextToken = formatString[0];\n if (nextToken && nextToken in tokens) {\n const nextLength = formatString.match(/^(.)\\1*/)[0].length;\n nextSource = tokens[nextToken].regex(locale, nextLength);\n }\n }\n\n const { numeric, source } = getTokenRegExp(\n tokens[token].regex(locale, length),\n nextSource,\n length,\n locale,\n previousNumeric,\n );\n const matchedValue = dateString.match(new RegExp(`^${source}`));\n\n if (!matchedValue) {\n throw new Error(`Unmatched token in DateTime string: ${token}`);\n }\n\n const literal = matchedValue[0];\n const value = tokens[token].input(locale, literal, length);\n\n if (value !== null) {\n const key = tokens[token].key;\n values.push({ key, value, literal, token, length });\n }\n\n dateString = dateString.substring(literal.length);\n previousTokenNumeric = numeric;\n }\n\n if (formatString) {\n parseCompare(formatString, dateString);\n dateString = dateString.substring(formatString.length);\n }\n\n if (dateString) {\n throw new Error(`Unmatched trailing characters in DateTime string: ${dateString}`);\n }\n\n let timeZone = requestedTimeZone;\n for (const { key, value } of values) {\n if (key !== 'timeZone') {\n continue;\n }\n\n timeZone = value;\n }\n\n let datetime = this.fromArray([1970, 1, 1], {\n locale,\n timeZone,\n });\n\n const methods = parseFactory();\n\n const testValues = [];\n\n for (const subKeys of parseOrderKeys) {\n for (const subKey of subKeys) {\n if (subKey === 'era' && !values.find((data) => data.key === 'year')) {\n continue;\n }\n\n for (const data of values) {\n const { key, value } = data;\n\n if (key !== subKey) {\n continue;\n }\n\n datetime = methods[key].set(datetime, value);\n testValues.push(data);\n }\n }\n }\n\n let isValid = true;\n for (const { key, value } of testValues) {\n if (key in methods && methods[key].get(datetime) !== value) {\n isValid = false;\n break;\n }\n }\n\n if (requestedTimeZone !== timeZone) {\n datetime = datetime.withTimeZone(requestedTimeZone);\n }\n\n datetime.isValid = isValid;\n\n return datetime;\n }\n\n /**\n * Creates a new DateTime from an ISO format string.\n * @param {string} dateString The date string.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @returns {DateTime} A new DateTime instance.\n */\n static fromISOString(dateString, options = {}) {\n let date = this.fromFormat(formats.rfc3339_extended, dateString, {\n locale: 'en',\n });\n\n if ('timeZone' in options) {\n date = date.withTimeZone(options.timeZone);\n }\n\n if ('locale' in options) {\n date = date.withLocale(options.locale);\n }\n\n return date;\n }\n\n /**\n * Creates a new DateTime from a timestamp.\n * @param {number} timestamp The number of seconds since the UNIX epoch.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @returns {DateTime} A new DateTime instance.\n */\n static fromTimestamp(timestamp, options = {}) {\n return new this(null, options)\n .withTimestamp(timestamp);\n }\n\n /**\n * Gets the default locale.\n * @returns {string} The locale.\n */\n static getDefaultLocale() {\n return config.defaultLocale;\n }\n\n /**\n * Gets the default time zone.\n * @returns {string} The default time zone.\n */\n static getDefaultTimeZone() {\n return config.defaultTimeZone;\n }\n\n /**\n * Checks whether the year is a leap year.\n * @param {number} year The year.\n * @returns {boolean} Whether the given year is a leap year.\n */\n static isLeapYear(year) {\n const date = new Date(0);\n date.setUTCFullYear(year, 1, 29);\n\n return date.getUTCDate() === 29;\n }\n\n /**\n * Creates a new DateTime for the current time.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n * @returns {DateTime} A new DateTime instance.\n */\n static now(options = {}) {\n return new this(null, options);\n }\n\n /**\n * Sets whether dates will be clamped when changing months.\n * @param {boolean} clampDates Whether to clamp dates.\n */\n static setDateClamping(clampDates) {\n config.clampDates = clampDates;\n }\n\n /**\n * Sets the default locale.\n * @param {string} locale The locale.\n */\n static setDefaultLocale(locale) {\n config.defaultLocale = locale;\n }\n\n /**\n * Sets the default time zone.\n * @param {string} timeZone The time zone name.\n */\n static setDefaultTimeZone(timeZone) {\n config.defaultTimeZone = timeZone;\n }\n\n /**\n * Creates a new DateTime from the current time, epoch milliseconds, or a date string.\n * @param {string|number|null} [date=null] The source date. Numbers are interpreted as milliseconds since the UNIX epoch.\n * @param {DateTimeOptions} [options={}] Options for the new DateTime.\n * @param {string} [options.timeZone] The time zone to use.\n * @param {string} [options.locale] The locale to use.\n */\n constructor(date = null, options = {}) {\n let timestamp;\n let adjustOffset = false;\n\n if (date === null) {\n timestamp = Date.now();\n } else if (typeof date === 'number' && Number.isFinite(date)) {\n timestamp = date;\n } else if (date === `${date}`) {\n timestamp = Date.parse(date);\n\n if (isNaN(timestamp)) {\n throw new Error('Invalid date string supplied');\n }\n\n adjustOffset = !dateStringTimeZoneRegExp.test(date);\n\n if (adjustOffset) {\n const localTimestamp = parseLocalTimestamp(date);\n\n if (localTimestamp === null) {\n timestamp -= new Date(timestamp).getTimezoneOffset() * 60000;\n } else {\n timestamp = localTimestamp;\n }\n }\n } else {\n throw new Error('Invalid date supplied');\n }\n\n this._date = new Date(timestamp);\n this._dynamicTz = false;\n this.isValid = true;\n\n let timeZone = options.timeZone;\n\n if (!timeZone) {\n timeZone = config.defaultTimeZone;\n }\n\n if (['Z', 'GMT'].includes(timeZone)) {\n timeZone = 'UTC';\n }\n\n const match = timeZone.match(offsetRegExp);\n if (match) {\n this._offset =\n match[2] * 60 +\n parseInt(match[4] || 0, 10) +\n parseInt(match[5] || 0, 10) / 60;\n if (this._offset && match[1] === '+') {\n this._offset *= -1;\n }\n\n if (this._offset) {\n this._timeZone = formatOffset(this._offset);\n } else {\n this._dynamicTz = true;\n this._timeZone = 'UTC';\n }\n } else {\n this._dynamicTz = true;\n this._timeZone = timeZone;\n }\n\n this._locale = 'locale' in options ?\n options.locale :\n config.defaultLocale;\n\n if (this._dynamicTz) {\n this._offset = getOffset(this);\n }\n\n if (adjustOffset && this._offset) {\n const resolvedDate = setOffsetTime(this, timestamp);\n this._date.setTime(resolvedDate.getTime());\n this._offset = resolvedDate.getTimeZoneOffset();\n }\n }\n\n /**\n * Adds a day to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addDay() {\n return this.addDays(1);\n }\n\n /**\n * Adds days to the current DateTime.\n * @param {number} amount The number of days to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addDays(amount) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(\n this.getDate() + amount,\n ),\n amount,\n );\n }\n\n /**\n * Adds an hour to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addHour() {\n return this.addHours(1);\n }\n\n /**\n * Adds hours to the current DateTime.\n * @param {number} amount The number of hours to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addHours(amount) {\n return this.withTime(\n this.getTime() + (amount * 3600000),\n );\n }\n\n /**\n * Adds a minute to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addMinute() {\n return this.addMinutes(1);\n }\n\n /**\n * Adds minutes to the current DateTime.\n * @param {number} amount The number of minutes to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addMinutes(amount) {\n return this.withTime(\n this.getTime() + (amount * 60000),\n );\n }\n\n /**\n * Adds a month to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addMonth() {\n return this.addMonths(1);\n }\n\n /**\n * Adds months to the current DateTime.\n * @param {number} amount The number of months to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addMonths(amount) {\n return this.withMonth(\n this.getMonth() + amount,\n );\n }\n\n /**\n * Adds a second to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addSecond() {\n return this.addSeconds(1);\n }\n\n /**\n * Adds seconds to the current DateTime.\n * @param {number} amount The number of seconds to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addSeconds(amount) {\n return this.withTime(\n this.getTime() + (amount * 1000),\n );\n }\n\n /**\n * Adds a week to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addWeek() {\n return this.addWeeks(1);\n }\n\n /**\n * Adds weeks to the current DateTime.\n * @param {number} amount The number of weeks to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addWeeks(amount) {\n return this.withDate(\n this.getDate() + (amount * 7),\n );\n }\n\n /**\n * Adds a year to the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n addYear() {\n return this.addYears(1);\n }\n\n /**\n * Adds years to the current DateTime.\n * @param {number} amount The number of years to add.\n * @returns {DateTime} A new DateTime instance.\n */\n addYears(amount) {\n return this.withYear(\n this.getYear() + amount,\n );\n }\n\n /**\n * Gets the localized day name for the current date.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of day name to return.\n * @returns {string} The localized day name.\n */\n dayName(type = 'long') {\n return formatDay(this.getLocale(), this.getDay(), type);\n }\n\n /**\n * Gets the localized day period for the current time.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of day period to return.\n * @returns {string} The localized day period.\n */\n dayPeriod(type = 'long') {\n return formatDayPeriod(\n this.getLocale(),\n this.getHours() < 12 ?\n 0 :\n 1,\n type,\n );\n }\n\n /**\n * Gets the number of days in the current month.\n * @returns {number} The number of days in the current month.\n */\n daysInMonth() {\n return this.constructor.daysInMonth(\n this.getYear(),\n this.getMonth(),\n );\n }\n\n /**\n * Gets the number of days in the current year.\n * @returns {number} The number of days in the current year.\n */\n daysInYear() {\n return this.constructor.daysInYear(\n this.getYear(),\n );\n }\n\n /**\n * Gets the difference between this and another Date in milliseconds.\n * @param {DateTime} other The date to compare to.\n * @returns {number} The difference.\n */\n diff(other) {\n return this - other;\n }\n\n /**\n * Gets the difference between this and another Date in days.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInDays(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'day', relative);\n }\n\n /**\n * Gets the difference between this and another Date in hours.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInHours(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'hour', relative);\n }\n\n /**\n * Gets the difference between this and another Date in minutes.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInMinutes(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'minute', relative);\n }\n\n /**\n * Gets the difference between this and another Date in months.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInMonths(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'month', relative);\n }\n\n /**\n * Gets the difference between this and another Date in seconds.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInSeconds(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'second', relative);\n }\n\n /**\n * Gets the difference between this and another Date in weeks.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInWeeks(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'week', relative);\n }\n\n /**\n * Gets the difference between this and another Date in years.\n * @param {DateTime} other The date to compare to.\n * @param {{relative?: boolean}} [options] Options for comparing the dates.\n * @returns {number} The difference.\n */\n diffInYears(other, { relative = true } = {}) {\n return calculateDiff(this, other, 'year', relative);\n }\n\n /**\n * Sets the DateTime to the end of the day.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfDay() {\n return this.withHours(23, 59, 59, 999);\n }\n\n /**\n * Sets the DateTime to the end of the hour.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfHour() {\n return this.withMinutes(59, 59, 999);\n }\n\n /**\n * Sets the DateTime to the end of the minute.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfMinute() {\n return this.withSeconds(59, 999);\n }\n\n /**\n * Sets the DateTime to the end of the month.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfMonth() {\n return this.withDate(this.daysInMonth())\n .endOfDay();\n }\n\n /**\n * Sets the DateTime to the end of the quarter.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfQuarter() {\n const month = this.getQuarter() * 3;\n return this.withMonth(month, this.constructor.daysInMonth(this.getYear(), month))\n .endOfDay();\n }\n\n /**\n * Sets the DateTime to the end of the second.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfSecond() {\n return this.withMilliseconds(999);\n }\n\n /**\n * Sets the DateTime to the end of the week.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfWeek() {\n return this.withWeekDay(7)\n .endOfDay();\n }\n\n /**\n * Sets the DateTime to the end of the year.\n * @returns {DateTime} A new DateTime instance.\n */\n endOfYear() {\n return this.withMonth(12, 31)\n .endOfDay();\n }\n\n /**\n * Gets the localized era for the current date.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of era to return.\n * @returns {string} The localized era.\n */\n era(type = 'long') {\n return formatEra(\n this.getLocale(),\n this.getYear() < 0 ?\n 0 :\n 1,\n type,\n );\n }\n\n /**\n * Formats the current date using a format string.\n * @param {string} formatString The format string.\n * @returns {string} The formatted date string.\n */\n format(formatString) {\n let match;\n let output = '';\n\n while (formatString && (match = formatString.match(formatTokenRegExp))) {\n const token = match[1];\n const position = match.index;\n const length = match[0].length;\n\n if (position) {\n output += formatString.substring(0, position);\n }\n\n formatString = formatString.substring(position + length);\n\n if (!token) {\n output += decodeLiteral(match[0]);\n continue;\n }\n\n if (!(token in tokens)) {\n throw new Error(`Invalid token in DateTime format: ${token}`);\n }\n\n if (tokens[token].supportsLength?.(length) === false) {\n throw new Error(`Unsupported token in DateTime format: ${token.repeat(length)}`);\n }\n\n output += tokens[token].output(this, length);\n }\n\n output += formatString;\n\n return output;\n }\n\n /**\n * Gets the date of the month in the current time zone.\n * @returns {number} The date of the month.\n */\n getDate() {\n return new Date(getOffsetTime(this)).getUTCDate();\n }\n\n /**\n * Gets the day of the week in the current time zone.\n * @returns {number} The day of the week. (0 = Sunday, 6 = Saturday)\n */\n getDay() {\n return new Date(getOffsetTime(this)).getUTCDay();\n }\n\n /**\n * Gets the day of the year in the current time zone.\n * @returns {number} The day of the year. (1-366)\n */\n getDayOfYear() {\n return this.constructor.dayOfYear(\n this.getYear(),\n this.getMonth(),\n this.getDate(),\n );\n }\n\n /**\n * Gets the hours of the day in the current time zone.\n * @returns {number} The hours of the day. (0-23)\n */\n getHours() {\n return new Date(getOffsetTime(this)).getUTCHours();\n }\n\n /**\n * Gets the current locale.\n * @returns {string} The locale.\n */\n getLocale() {\n return this._locale;\n }\n\n /**\n * Gets the milliseconds in the current time zone.\n * @returns {number} The milliseconds.\n */\n getMilliseconds() {\n return new Date(getOffsetTime(this)).getUTCMilliseconds();\n }\n\n /**\n * Gets the minutes in the current time zone.\n * @returns {number} The minutes. (0-59)\n */\n getMinutes() {\n return new Date(getOffsetTime(this)).getUTCMinutes();\n }\n\n /**\n * Gets the month in the current time zone.\n * @returns {number} The month. (1-12)\n */\n getMonth() {\n return new Date(getOffsetTime(this)).getUTCMonth() + 1;\n }\n\n /**\n * Gets the quarter of the year in the current time zone.\n * @returns {number} The quarter of the year. (1-4)\n */\n getQuarter() {\n return Math.ceil(this.getMonth() / 3);\n }\n\n /**\n * Gets the seconds in the current time zone.\n * @returns {number} The seconds. (0-59)\n */\n getSeconds() {\n return new Date(getOffsetTime(this)).getUTCSeconds();\n }\n\n /**\n * Gets the number of milliseconds since the UNIX epoch.\n * @returns {number} The number of milliseconds since the UNIX epoch.\n */\n getTime() {\n return this._date.getTime();\n }\n\n /**\n * Gets the number of seconds since the UNIX epoch.\n * @returns {number} The number of seconds since the UNIX epoch.\n */\n getTimestamp() {\n return Math.floor(this.getTime() / 1000);\n }\n\n /**\n * Gets the current time zone.\n * @returns {string} The time zone.\n */\n getTimeZone() {\n return this._timeZone;\n }\n\n /**\n * Gets the current UTC offset in minutes.\n * @returns {number} The UTC offset in minutes.\n */\n getTimeZoneOffset() {\n return this._offset;\n }\n\n /**\n * Gets the local week in the current time zone.\n * @returns {number} The local week. (1-53)\n */\n getWeek() {\n const thisWeek = this.startOfDay().withWeekDay(1);\n const firstWeek = thisWeek.withWeek(1, 1);\n\n return 1 + Math.floor(\n (getOffsetTime(thisWeek) - getOffsetTime(firstWeek)) /\n 604800000,\n );\n }\n\n /**\n * Gets the local day of the week in the current time zone.\n * @returns {number} The local day of the week. (1-7)\n */\n getWeekDay() {\n return weekDay(\n this.getLocale(),\n this.getDay(),\n );\n }\n\n /**\n * Gets the week day in month in the current time zone.\n * @returns {number} The week day in month.\n */\n getWeekDayInMonth() {\n const thisWeek = this.getWeek();\n const first = this.withDate(1);\n const firstWeek = first.getWeek();\n const offset = first.getWeekDay() > this.getWeekDay() ?\n 0 : 1;\n return firstWeek > thisWeek ?\n thisWeek + offset :\n thisWeek - firstWeek + offset;\n }\n\n /**\n * Gets the week of month in the current time zone.\n * @returns {number} The week of month.\n */\n getWeekOfMonth() {\n const thisWeek = this.getWeek();\n const firstWeek = this.withDate(1).getWeek();\n return firstWeek > thisWeek ?\n thisWeek + 1 :\n thisWeek - firstWeek + 1;\n }\n\n /**\n * Gets the week year in the current time zone.\n * @returns {number} The week year.\n */\n getWeekYear() {\n const minDays = minimumDays(this.getLocale());\n return this.withWeekDay(7 - minDays + 1).getYear();\n }\n\n /**\n * Gets the year in the current time zone.\n * @returns {number} The year.\n */\n getYear() {\n return new Date(getOffsetTime(this)).getUTCFullYear();\n }\n\n /**\n * Gets the difference between this and another Date in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in human readable form.\n */\n humanDiff(other) {\n const [amount, unit] = getBiggestDiff(this, other);\n return formatRelative(this.getLocale(), amount, unit);\n }\n\n /**\n * Gets the difference between this and another Date in days in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in days in human readable form.\n */\n humanDiffInDays(other) {\n return formatRelative(this.getLocale(), this.diffInDays(other), 'day');\n }\n\n /**\n * Gets the difference between this and another Date in hours in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in hours in human readable form.\n */\n humanDiffInHours(other) {\n return formatRelative(this.getLocale(), this.diffInHours(other), 'hour');\n }\n\n /**\n * Gets the difference between this and another Date in minutes in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in minutes in human readable form.\n */\n humanDiffInMinutes(other) {\n return formatRelative(this.getLocale(), this.diffInMinutes(other), 'minute');\n }\n\n /**\n * Gets the difference between this and another Date in months in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in months in human readable form.\n */\n humanDiffInMonths(other) {\n return formatRelative(this.getLocale(), this.diffInMonths(other), 'month');\n }\n\n /**\n * Gets the difference between this and another Date in seconds in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in seconds in human readable form.\n */\n humanDiffInSeconds(other) {\n return formatRelative(this.getLocale(), this.diffInSeconds(other), 'second');\n }\n\n /**\n * Gets the difference between this and another Date in weeks in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in weeks in human readable form.\n */\n humanDiffInWeeks(other) {\n return formatRelative(this.getLocale(), this.diffInWeeks(other), 'week');\n }\n\n /**\n * Gets the difference between this and another Date in years in human readable form.\n * @param {DateTime} other The date to compare to.\n * @returns {string} The difference in years in human readable form.\n */\n humanDiffInYears(other) {\n return formatRelative(this.getLocale(), this.diffInYears(other), 'year');\n }\n\n /**\n * Checks whether this DateTime is after another date.\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date.\n */\n isAfter(other) {\n return this.diff(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by day).\n */\n isAfterDay(other) {\n return this.diffInDays(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by hour).\n */\n isAfterHour(other) {\n return this.diffInHours(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by minute).\n */\n isAfterMinute(other) {\n return this.diffInMinutes(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by month).\n */\n isAfterMonth(other) {\n return this.diffInMonths(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by second).\n */\n isAfterSecond(other) {\n return this.diffInSeconds(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by week).\n */\n isAfterWeek(other) {\n return this.diffInWeeks(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is after another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is after the other date (comparing by year).\n */\n isAfterYear(other) {\n return this.diffInYears(other) > 0;\n }\n\n /**\n * Checks whether this DateTime is before another date.\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date.\n */\n isBefore(other) {\n return this.diff(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by day).\n */\n isBeforeDay(other) {\n return this.diffInDays(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by hour).\n */\n isBeforeHour(other) {\n return this.diffInHours(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by minute).\n */\n isBeforeMinute(other) {\n return this.diffInMinutes(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by month).\n */\n isBeforeMonth(other) {\n return this.diffInMonths(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by second).\n */\n isBeforeSecond(other) {\n return this.diffInSeconds(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by week).\n */\n isBeforeWeek(other) {\n return this.diffInWeeks(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is before another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is before the other date (comparing by year).\n */\n isBeforeYear(other) {\n return this.diffInYears(other) < 0;\n }\n\n /**\n * Checks whether this DateTime is between two other dates.\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates.\n */\n isBetween(start, end) {\n return this.isAfter(start) && this.isBefore(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by day).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by day).\n */\n isBetweenDay(start, end) {\n return this.isAfterDay(start) && this.isBeforeDay(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by hour).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by hour).\n */\n isBetweenHour(start, end) {\n return this.isAfterHour(start) && this.isBeforeHour(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by minute).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by minute).\n */\n isBetweenMinute(start, end) {\n return this.isAfterMinute(start) && this.isBeforeMinute(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by month).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by month).\n */\n isBetweenMonth(start, end) {\n return this.isAfterMonth(start) && this.isBeforeMonth(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by second).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by second).\n */\n isBetweenSecond(start, end) {\n return this.isAfterSecond(start) && this.isBeforeSecond(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by week).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by week).\n */\n isBetweenWeek(start, end) {\n return this.isAfterWeek(start) && this.isBeforeWeek(end);\n }\n\n /**\n * Checks whether this DateTime is between two other dates (comparing by year).\n * @param {DateTime} start The first date to compare to.\n * @param {DateTime} end The second date to compare to.\n * @returns {boolean} Whether this DateTime is between two other dates (comparing by year).\n */\n isBetweenYear(start, end) {\n return this.isAfterYear(start) && this.isBeforeYear(end);\n }\n\n /**\n * Checks whether the DateTime is in daylight saving time.\n * @returns {boolean} Whether the current time is in daylight saving time.\n */\n isDst() {\n if (!this._dynamicTz) {\n return false;\n }\n\n const year = this.getYear();\n const dateA = this.constructor.fromArray([year, 1, 1], {\n timeZone: this.getTimeZone(),\n });\n const dateB = this.constructor.fromArray([year, 6, 1], {\n timeZone: this.getTimeZone(),\n });\n\n return this.getTimeZoneOffset() < Math.max(dateA.getTimeZoneOffset(), dateB.getTimeZoneOffset());\n }\n\n /**\n * Checks whether the year is a leap year.\n * @returns {boolean} Whether the current year is a leap year.\n */\n isLeapYear() {\n return this.constructor.isLeapYear(\n this.getYear(),\n );\n }\n\n /**\n * Checks whether this DateTime is the same as another date.\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date.\n */\n isSame(other) {\n return this.diff(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by day).\n */\n isSameDay(other) {\n return this.diffInDays(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by hour).\n */\n isSameHour(other) {\n return this.diffInHours(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by minute).\n */\n isSameMinute(other) {\n return this.diffInMinutes(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by month).\n */\n isSameMonth(other) {\n return this.diffInMonths(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date.\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date.\n */\n isSameOrAfter(other) {\n return this.diff(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by day).\n */\n isSameOrAfterDay(other) {\n return this.diffInDays(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by hour).\n */\n isSameOrAfterHour(other) {\n return this.diffInHours(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by minute).\n */\n isSameOrAfterMinute(other) {\n return this.diffInMinutes(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by month).\n */\n isSameOrAfterMonth(other) {\n return this.diffInMonths(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by second).\n */\n isSameOrAfterSecond(other) {\n return this.diffInSeconds(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by week).\n */\n isSameOrAfterWeek(other) {\n return this.diffInWeeks(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or after another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or after the other date (comparing by year).\n */\n isSameOrAfterYear(other) {\n return this.diffInYears(other) >= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date.\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date.\n */\n isSameOrBefore(other) {\n return this.diff(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by day).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by day).\n */\n isSameOrBeforeDay(other) {\n return this.diffInDays(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by hour).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by hour).\n */\n isSameOrBeforeHour(other) {\n return this.diffInHours(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by minute).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by minute).\n */\n isSameOrBeforeMinute(other) {\n return this.diffInMinutes(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by month).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by month).\n */\n isSameOrBeforeMonth(other) {\n return this.diffInMonths(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by second).\n */\n isSameOrBeforeSecond(other) {\n return this.diffInSeconds(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by week).\n */\n isSameOrBeforeWeek(other) {\n return this.diffInWeeks(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as or before another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as or before the other date (comparing by year).\n */\n isSameOrBeforeYear(other) {\n return this.diffInYears(other) <= 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by second).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by second).\n */\n isSameSecond(other) {\n return this.diffInSeconds(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by week).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by week).\n */\n isSameWeek(other) {\n return this.diffInWeeks(other) === 0;\n }\n\n /**\n * Checks whether this DateTime is the same as another date (comparing by year).\n * @param {DateTime} other The date to compare to.\n * @returns {boolean} Whether this DateTime is the same as the other date (comparing by year).\n */\n isSameYear(other) {\n return this.diffInYears(other) === 0;\n }\n\n /**\n * Gets the localized month name for the current date.\n * @param {'long'|'short'|'narrow'} [type='long'] The type of month name to return.\n * @returns {string} The localized month name.\n */\n monthName(type = 'long') {\n return formatMonth(this.getLocale(), this.getMonth(), type);\n }\n\n /**\n * Sets the DateTime to the start of the day.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfDay() {\n return this.withHours(0, 0, 0, 0);\n }\n\n /**\n * Sets the DateTime to the start of the hour.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfHour() {\n return this.withMinutes(0, 0, 0);\n }\n\n /**\n * Sets the DateTime to the start of the minute.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfMinute() {\n return this.withSeconds(0, 0);\n }\n\n /**\n * Sets the DateTime to the start of the month.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfMonth() {\n return this.withDate(1)\n .startOfDay();\n }\n\n /**\n * Sets the DateTime to the start of the quarter.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfQuarter() {\n const month = this.getQuarter() * 3 - 2;\n return this.withMonth(month, 1)\n .startOfDay();\n }\n\n /**\n * Sets the DateTime to the start of the second.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfSecond() {\n return this.withMilliseconds(0);\n }\n\n /**\n * Sets the DateTime to the start of the week.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfWeek() {\n return this.withWeekDay(1)\n .startOfDay();\n }\n\n /**\n * Sets the DateTime to the start of the year.\n * @returns {DateTime} A new DateTime instance.\n */\n startOfYear() {\n return this.withMonth(1, 1)\n .startOfDay();\n }\n\n /**\n * Subtracts a day from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subDay() {\n return this.addDays(-1);\n }\n\n /**\n * Subtracts days from the current DateTime.\n * @param {number} amount The number of days to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subDays(amount) {\n return this.addDays(-amount);\n }\n\n /**\n * Subtracts an hour from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subHour() {\n return this.addHours(-1);\n }\n\n /**\n * Subtracts hours from the current DateTime.\n * @param {number} amount The number of hours to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subHours(amount) {\n return this.addHours(-amount);\n }\n\n /**\n * Subtracts a minute from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subMinute() {\n return this.addMinutes(-1);\n }\n\n /**\n * Subtracts minutes from the current DateTime.\n * @param {number} amount The number of minutes to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subMinutes(amount) {\n return this.addMinutes(-amount);\n }\n\n /**\n * Subtracts a month from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subMonth() {\n return this.addMonths(-1);\n }\n\n /**\n * Subtracts months from the current DateTime.\n * @param {number} amount The number of months to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subMonths(amount) {\n return this.addMonths(-amount);\n }\n\n /**\n * Subtracts a second from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subSecond() {\n return this.addSeconds(-1);\n }\n\n /**\n * Subtracts seconds from the current DateTime.\n * @param {number} amount The number of seconds to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subSeconds(amount) {\n return this.addSeconds(-amount);\n }\n\n /**\n * Subtracts a week from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subWeek() {\n return this.addWeeks(-1);\n }\n\n /**\n * Subtracts weeks from the current DateTime.\n * @param {number} amount The number of weeks to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subWeeks(amount) {\n return this.addWeeks(-amount);\n }\n\n /**\n * Subtracts a year from the current DateTime.\n * @returns {DateTime} A new DateTime instance.\n */\n subYear() {\n return this.addYears(-1);\n }\n\n /**\n * Subtracts years from the current DateTime.\n * @param {number} amount The number of years to subtract.\n * @returns {DateTime} A new DateTime instance.\n */\n subYears(amount) {\n return this.addYears(-amount);\n }\n\n /**\n * Returns the primitive representation of the DateTime.\n * @param {'default'|'number'|'string'} hint The conversion hint.\n * @returns {string|number} A string for default/string coercion or epoch milliseconds for numeric coercion.\n */\n [Symbol.toPrimitive](hint) {\n return hint === 'number' ?\n this.valueOf() :\n this.toString();\n }\n\n /**\n * Gets the name of the current time zone.\n * @param {'long'|'short'} [type='long'] The formatting type.\n * @returns {string} The name of the time zone.\n */\n timeZoneName(type = 'long') {\n return this._dynamicTz ?\n formatTimeZoneName(this.getLocale(), this.getTime(), this.getTimeZone(), type) :\n 'GMT' + formatOffset(this.getTimeZoneOffset(), true, type === 'short');\n }\n\n /**\n * Formats the current date using \"eee MMM dd yyyy\".\n * @returns {string} The formatted date string.\n */\n toDateString() {\n return this.format(formats.date);\n }\n\n /**\n * Formats the current date using \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\".\n * @returns {string} The formatted date string.\n */\n toIsoString() {\n return this\n .withLocale('en')\n .withTimeZone('UTC')\n .format(formats.rfc3339_extended);\n }\n\n /**\n * Returns the JSON representation of the current date.\n * @returns {string|null} The ISO string for valid dates or null for invalid dates.\n */\n toJSON() {\n return this.isValid ?\n this.toIsoString() :\n null;\n }\n\n /**\n * Formats the current date using \"eee MMM dd yyyy HH:mm:ss xx (VV)\".\n * @returns {string} The formatted date string.\n */\n toString() {\n return this.format(formats.string);\n }\n\n /**\n * Formats the current date using \"HH:mm:ss xx (VV)\".\n * @returns {string} The formatted date string.\n */\n toTimeString() {\n return this.format(formats.time);\n }\n\n /**\n * Formats the current date in the UTC time zone using \"eee MMM dd yyyy HH:mm:ss xx (VV)\".\n * @returns {string} The formatted date string.\n */\n toUTCString() {\n return this\n .withLocale('en')\n .withTimeZone('UTC')\n .toString();\n }\n\n /**\n * Returns the number of milliseconds since the UNIX epoch.\n * @returns {number} The number of milliseconds since the UNIX epoch.\n */\n valueOf() {\n return this.getTime();\n }\n\n /**\n * Gets the number of weeks in the current year.\n * @returns {number} The number of weeks in the current year.\n */\n weeksInYear() {\n const minDays = minimumDays(this.getLocale());\n return this.withMonth(12, 24 + minDays).getWeek();\n }\n\n /**\n * Returns a copy with the date of the month changed in the current time zone.\n * @param {number} date The date of the month.\n * @returns {DateTime} A new DateTime instance.\n */\n withDate(date) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(date),\n );\n }\n\n /**\n * Returns a copy with the day of the week changed in the current time zone.\n * @param {number} day The day of the week. (0 = Sunday, 6 = Saturday)\n * @returns {DateTime} A new DateTime instance.\n */\n withDay(day) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(\n this.getDate() -\n this.getDay() +\n parseInt(day, 10),\n ),\n );\n }\n\n /**\n * Returns a copy with the day of the year changed in the current time zone.\n * @param {number} day The day of the year. (1-366)\n * @returns {DateTime} A new DateTime instance.\n */\n withDayOfYear(day) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMonth(\n 0,\n day,\n ),\n );\n }\n\n /**\n * Returns a copy with the hours changed in the current time zone.\n * @param {number} hours The hours. (0-23)\n * @param {number} [minutes] The minutes. (0-59)\n * @param {number} [seconds] The seconds. (0-59)\n * @param {number} [milliseconds] The milliseconds.\n * @returns {DateTime} A new DateTime instance.\n */\n withHours(...args) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCHours(...args),\n );\n }\n\n /**\n * Returns a copy with a different locale.\n * @param {string} locale The locale to use.\n * @returns {DateTime} A new DateTime instance.\n */\n withLocale(locale) {\n return new this.constructor(this.getTime(), {\n locale,\n timeZone: this._timeZone,\n });\n }\n\n /**\n * Returns a copy with the milliseconds changed in the current time zone.\n * @param {number} milliseconds The milliseconds.\n * @returns {DateTime} A new DateTime instance.\n */\n withMilliseconds(milliseconds) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMilliseconds(milliseconds),\n );\n }\n\n /**\n * Returns a copy with the minutes changed in the current time zone.\n * @param {number} minutes The minutes. (0-59)\n * @param {number} [seconds] The seconds. (0-59)\n * @param {number} [milliseconds] The milliseconds.\n * @returns {DateTime} A new DateTime instance.\n */\n withMinutes(...args) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMinutes(...args),\n );\n }\n\n /**\n * Returns a copy with the month changed in the current time zone.\n * @param {number} month The month. (1-12)\n * @param {number|null} [date] The date of the month.\n * @returns {DateTime} A new DateTime instance.\n */\n withMonth(month, date = null) {\n if (date === null) {\n date = this.getDate();\n\n if (config.clampDates) {\n date = Math.min(\n date,\n this.constructor.daysInMonth(\n this.getYear(),\n month,\n ),\n );\n }\n }\n\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMonth(\n month - 1,\n date,\n ),\n );\n }\n\n /**\n * Returns a copy with the quarter of the year changed in the current time zone.\n * @param {number} quarter The quarter of the year. (1-4)\n * @returns {DateTime} A new DateTime instance.\n */\n withQuarter(quarter) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCMonth(\n quarter * 3 -\n 3,\n ),\n );\n }\n\n /**\n * Returns a copy with the seconds changed in the current time zone.\n * @param {number} seconds The seconds. (0-59)\n * @param {number} [milliseconds] The milliseconds.\n * @returns {DateTime} A new DateTime instance.\n */\n withSeconds(...args) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCSeconds(...args),\n );\n }\n\n /**\n * Returns a copy with a different epoch-millisecond value.\n * @param {number} time The number of milliseconds since the UNIX epoch.\n * @returns {DateTime} A new DateTime instance.\n */\n withTime(time) {\n return new this.constructor(time, {\n locale: this._locale,\n timeZone: this._timeZone,\n });\n }\n\n /**\n * Returns a copy with a different number of seconds since the UNIX epoch.\n * @param {number} timestamp The number of seconds since the UNIX epoch.\n * @returns {DateTime} A new DateTime instance.\n */\n withTimestamp(timestamp) {\n return this.withTime(timestamp * 1000);\n }\n\n /**\n * Returns a copy in a different time zone.\n * @param {string} timeZone The time zone to use.\n * @returns {DateTime} A new DateTime instance.\n */\n withTimeZone(timeZone) {\n return new this.constructor(this.getTime(), {\n locale: this._locale,\n timeZone,\n });\n }\n\n /**\n * Returns a copy with a fixed numeric UTC offset.\n * @param {number} offset The UTC offset in minutes.\n * @returns {DateTime} A new DateTime instance.\n */\n withTimeZoneOffset(offset) {\n return new this.constructor(this.getTime(), {\n locale: this._locale,\n timeZone: formatOffset(offset),\n });\n }\n\n /**\n * Returns a copy with the local week changed in the current time zone.\n * @param {number} week The local week.\n * @param {number|null} [day] The local day of the week. (1-7)\n * @returns {DateTime} A new DateTime instance.\n */\n withWeek(week, day = null) {\n if (day === null) {\n day = this.getWeekDay();\n }\n\n const minDays = minimumDays(this.getLocale());\n return this.withYear(this.getWeekYear(), 1, minDays + ((week - 1) * 7)).withWeekDay(day);\n }\n\n /**\n * Returns a copy with the local day of the week changed in the current time zone.\n * @param {number} day The local day of the week. (1-7)\n * @returns {DateTime} A new DateTime instance.\n */\n withWeekDay(day) {\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCDate(\n this.getDate() -\n this.getWeekDay() +\n parseInt(day, 10),\n ),\n );\n }\n\n /**\n * Returns a copy with the week day in month changed in the current time zone.\n * @param {number} week The week day in month.\n * @returns {DateTime} A new DateTime instance.\n */\n withWeekDayInMonth(week) {\n return this.withDate(\n this.getDate() +\n (\n week -\n this.getWeekDayInMonth()\n ) * 7,\n );\n }\n\n /**\n * Returns a copy with the week of month changed in the current time zone.\n * @param {number} week The week of month.\n * @returns {DateTime} A new DateTime instance.\n */\n withWeekOfMonth(week) {\n return this.withDate(\n this.getDate() +\n (\n week -\n this.getWeekOfMonth()\n ) * 7,\n );\n }\n\n /**\n * Returns a copy with the local week year changed in the current time zone.\n * @param {number} year The local week year.\n * @param {number|null} [week] The local week.\n * @param {number|null} [day] The local day of the week. (1-7)\n * @returns {DateTime} A new DateTime instance.\n */\n withWeekYear(year, week = null, day = null) {\n const minDays = minimumDays(this.getLocale());\n const Constructor = this.constructor;\n\n if (week === null) {\n week = Math.min(\n this.getWeek(),\n Constructor.fromArray([year, 1, minDays], {\n locale: this.getLocale(),\n timeZone: this.getTimeZone(),\n }).weeksInYear(),\n );\n }\n\n if (day === null) {\n day = this.getWeekDay();\n }\n\n return this.withYear(year, 1, minDays + ((week - 1) * 7)).withWeekDay(day);\n }\n\n /**\n * Returns a copy with the year changed in the current time zone.\n * @param {number} year The year.\n * @param {number|null} [month] The month. (1-12)\n * @param {number|null} [date] The date of the month.\n * @returns {DateTime} A new DateTime instance.\n */\n withYear(year, month = null, date = null) {\n if (month === null) {\n month = this.getMonth();\n }\n\n if (date === null) {\n date = this.getDate();\n\n if (config.clampDates) {\n date = Math.min(\n date,\n this.constructor.daysInMonth(\n year,\n month,\n ),\n );\n }\n }\n\n return setOffsetTime(\n this,\n new Date(getOffsetTime(this)).setUTCFullYear(\n year,\n month - 1,\n date,\n ),\n );\n }\n}\n"],"mappings":"wOAIA,MAAMA,EAAO,IAAIC,IAgBV,SAASC,EAAQC,EAAKC,GAKzB,OAJKJ,EAAKK,IAAIF,IACVH,EAAKM,IAAIH,EAAKC,KAGXJ,EAAKO,IAAIJ,EACpB,CAkDO,SAASK,EAAcC,EAAQC,GAClC,OAAO,IAAIC,KAAKC,eAAeH,EAAQ,CACnCI,SAAU,SACPH,EACHI,SAAU,WAElB,CC9EA,MAAMC,GAAkB,IAAIJ,KAAKC,gBAAiBG,kBAErCC,EAAS,CAClBC,YAAY,EACZC,cAAeH,EAAgBN,OAC/BU,gBAAiBJ,EAAgBF,UAGxBO,EAA2B,4FAE3BC,EACH,kBADGA,EAES,+BAFTA,EAGD,mCAHCA,EAIH,mBAGGC,EAAoB,gCAEpBC,EAAY,CAAC,GAAI,GAAI,GAAI,G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