: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
* which would lead to incorrect calculations.
* This function returns the timezone offset in milliseconds that takes seconds in account.
function getTimezoneOffsetInMilliseconds(date) {
const _date = toDate_toDate(date);
const utcDate = new Date(
utcDate.setUTCFullYear(_date.getFullYear());
;// CONCATENATED MODULE: ./node_modules/date-fns/differenceInCalendarDays.mjs
* @name differenceInCalendarDays
* @summary Get the number of calendar days between the given dates.
* Get the number of calendar days between the given dates. This means that the times are removed
* from the dates and then the difference in days is calculated.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param dateLeft - The later date
* @param dateRight - The earlier date
* @returns The number of calendar days
* // How many calendar days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* const result = differenceInCalendarDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* const result = differenceInCalendarDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
function differenceInCalendarDays(dateLeft, dateRight) {
const startOfDayLeft = startOfDay_startOfDay(dateLeft);
const startOfDayRight = startOfDay_startOfDay(dateRight);
+startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);
+startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);
// Round the number of days to the nearest integer because the number of
// milliseconds in a day is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round((timestampLeft - timestampRight) / millisecondsInDay);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_differenceInCalendarDays = ((/* unused pure expression or super */ null && (differenceInCalendarDays)));
;// CONCATENATED MODULE: ./node_modules/date-fns/startOfYear.mjs
* @summary Return the start of a year for the given date.
* Return the start of a year for the given date.
* The result will be in the local timezone.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @returns The start of a year
* // The start of a year for 2 September 2014 11:55:00:
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Jan 01 2014 00:00:00
function startOfYear(date) {
const cleanDate = toDate_toDate(date);
const _date = constructFrom_constructFrom(date, 0);
_date.setFullYear(cleanDate.getFullYear(), 0, 1);
_date.setHours(0, 0, 0, 0);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfYear = ((/* unused pure expression or super */ null && (startOfYear)));
;// CONCATENATED MODULE: ./node_modules/date-fns/getDayOfYear.mjs
* @summary Get the day of the year of the given date.
* Get the day of the year of the given date.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The given date
* @returns The day of year
* // Which day of the year is 2 July 2014?
* const result = getDayOfYear(new Date(2014, 6, 2))
function getDayOfYear(date) {
const _date = toDate_toDate(date);
const diff = differenceInCalendarDays(_date, startOfYear(_date));
const dayOfYear = diff + 1;
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getDayOfYear = ((/* unused pure expression or super */ null && (getDayOfYear)));
;// CONCATENATED MODULE: ./node_modules/date-fns/startOfWeek.mjs
* The {@link startOfWeek} function options.
* @summary Return the start of a week for the given date.
* Return the start of a week for the given date.
* The result will be in the local timezone.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @param options - An object with options
* @returns The start of a week
* // The start of a week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sun Aug 31 2014 00:00:00
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
* //=> Mon Sep 01 2014 00:00:00
function startOfWeek_startOfWeek(date, options) {
const defaultOptions = defaultOptions_getDefaultOptions();
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
const _date = toDate_toDate(date);
const day = _date.getDay();
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
_date.setDate(_date.getDate() - diff);
_date.setHours(0, 0, 0, 0);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfWeek = ((/* unused pure expression or super */ null && (startOfWeek_startOfWeek)));
;// CONCATENATED MODULE: ./node_modules/date-fns/startOfISOWeek.mjs
* @category ISO Week Helpers
* @summary Return the start of an ISO week for the given date.
* Return the start of an ISO week for the given date.
* The result will be in the local timezone.
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @returns The start of an ISO week
* // The start of an ISO week for 2 September 2014 11:55:00:
* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
function startOfISOWeek(date) {
return startOfWeek_startOfWeek(date, { weekStartsOn: 1 });
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfISOWeek = ((/* unused pure expression or super */ null && (startOfISOWeek)));
;// CONCATENATED MODULE: ./node_modules/date-fns/getISOWeekYear.mjs
* @category ISO Week-Numbering Year Helpers
* @summary Get the ISO week-numbering year of the given date.
* Get the ISO week-numbering year of the given date,
* which always starts 3 days before the year's first Thursday.
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The given date
* @returns The ISO week-numbering year
* // Which ISO-week numbering year is 2 January 2005?
* const result = getISOWeekYear(new Date(2005, 0, 2))
function getISOWeekYear(date) {
const _date = toDate_toDate(date);
const year = _date.getFullYear();
const fourthOfJanuaryOfNextYear = constructFrom_constructFrom(date, 0);
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
const fourthOfJanuaryOfThisYear = constructFrom_constructFrom(date, 0);
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
if (_date.getTime() >= startOfNextYear.getTime()) {
} else if (_date.getTime() >= startOfThisYear.getTime()) {
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getISOWeekYear = ((/* unused pure expression or super */ null && (getISOWeekYear)));
;// CONCATENATED MODULE: ./node_modules/date-fns/startOfISOWeekYear.mjs
* @name startOfISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Return the start of an ISO week-numbering year for the given date.
* Return the start of an ISO week-numbering year,
* which always starts 3 days before the year's first Thursday.
* The result will be in the local timezone.
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @returns The start of an ISO week-numbering year
* // The start of an ISO week-numbering year for 2 July 2005:
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
* //=> Mon Jan 03 2005 00:00:00
function startOfISOWeekYear(date) {
const year = getISOWeekYear(date);
const fourthOfJanuary = constructFrom_constructFrom(date, 0);
fourthOfJanuary.setFullYear(year, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
return startOfISOWeek(fourthOfJanuary);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfISOWeekYear = ((/* unused pure expression or super */ null && (startOfISOWeekYear)));
;// CONCATENATED MODULE: ./node_modules/date-fns/getISOWeek.mjs
* @category ISO Week Helpers
* @summary Get the ISO week of the given date.
* Get the ISO week of the given date.
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The given date
* // Which week of the ISO-week numbering year is 2 January 2005?
* const result = getISOWeek(new Date(2005, 0, 2))
function getISOWeek(date) {
const _date = toDate_toDate(date);
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / millisecondsInWeek) + 1;
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getISOWeek = ((/* unused pure expression or super */ null && (getISOWeek)));
;// CONCATENATED MODULE: ./node_modules/date-fns/getWeekYear.mjs
* The {@link getWeekYear} function options.
* @category Week-Numbering Year Helpers
* @summary Get the local week-numbering year of the given date.
* Get the local week-numbering year of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The given date
* @param options - An object with options.
* @returns The local week-numbering year
* // Which week numbering year is 26 December 2004 with the default settings?
* const result = getWeekYear(new Date(2004, 11, 26))
* // Which week numbering year is 26 December 2004 if week starts on Saturday?
* const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
* // Which week numbering year is 26 December 2004 if the first week contains 4 January?
* const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
function getWeekYear(date, options) {
const _date = toDate_toDate(date);
const year = _date.getFullYear();
const defaultOptions = defaultOptions_getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
const firstWeekOfNextYear = constructFrom_constructFrom(date, 0);
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfWeek_startOfWeek(firstWeekOfNextYear, options);
const firstWeekOfThisYear = constructFrom_constructFrom(date, 0);
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfWeek_startOfWeek(firstWeekOfThisYear, options);
if (_date.getTime() >= startOfNextYear.getTime()) {
} else if (_date.getTime() >= startOfThisYear.getTime()) {
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getWeekYear = ((/* unused pure expression or super */ null && (getWeekYear)));
;// CONCATENATED MODULE: ./node_modules/date-fns/startOfWeekYear.mjs
* The {@link startOfWeekYear} function options.
* @category Week-Numbering Year Helpers
* @summary Return the start of a local week-numbering year for the given date.
* Return the start of a local week-numbering year.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @param options - An object with options
* @returns The start of a week-numbering year
* // The start of an a week-numbering year for 2 July 2005 with default settings:
* const result = startOfWeekYear(new Date(2005, 6, 2))
* //=> Sun Dec 26 2004 00:00:00
* // The start of a week-numbering year for 2 July 2005
* // if Monday is the first day of week
* // and 4 January is always in the first week of the year:
* const result = startOfWeekYear(new Date(2005, 6, 2), {
* firstWeekContainsDate: 4
* //=> Mon Jan 03 2005 00:00:00
function startOfWeekYear(date, options) {
const defaultOptions = defaultOptions_getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??