: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const year = getWeekYear(date, options);
const firstWeek = constructFrom_constructFrom(date, 0);
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
firstWeek.setHours(0, 0, 0, 0);
const _date = startOfWeek_startOfWeek(firstWeek, options);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfWeekYear = ((/* unused pure expression or super */ null && (startOfWeekYear)));
;// CONCATENATED MODULE: ./node_modules/date-fns/getWeek.mjs
* The {@link getWeek} function options.
* @summary Get the local week index of the given date.
* Get the local week index 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
* // Which week of the local week numbering year is 2 January 2005 with default options?
* const result = getWeek(new Date(2005, 0, 2))
* // Which week of the local week numbering year is 2 January 2005,
* // if Monday is the first day of the week,
* // and the first week of the year always contains 4 January?
* const result = getWeek(new Date(2005, 0, 2), {
* firstWeekContainsDate: 4
function getWeek(date, options) {
const _date = toDate_toDate(date);
const diff = +startOfWeek_startOfWeek(_date, options) - +startOfWeekYear(_date, options);
// 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_getWeek = ((/* unused pure expression or super */ null && (getWeek)));
;// CONCATENATED MODULE: ./node_modules/date-fns/_lib/addLeadingZeros.mjs
function addLeadingZeros(number, targetLength) {
const sign = number < 0 ? "-" : "";
const output = Math.abs(number).toString().padStart(targetLength, "0");
;// CONCATENATED MODULE: ./node_modules/date-fns/_lib/format/lightFormatters.mjs
* |-----|--------------------------------|-----|--------------------------------|
* | d | Day of month | D | |
* | h | Hour [1-12] | H | Hour [0-23] |
* | m | Minute | M | Month |
* | s | Second | S | Fraction of second |
* | y | Year (abs) | Y | |
* Letters marked by * are not implemented but reserved by Unicode standard.
const lightFormatters = {
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year | y | yy | yyy | yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
const month = date.getMonth();
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
return addLeadingZeros(date.getDate(), token.length);
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
return dayPeriodEnumValue.toUpperCase();
return dayPeriodEnumValue;
return dayPeriodEnumValue[0];
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
return addLeadingZeros(date.getHours(), token.length);
return addLeadingZeros(date.getMinutes(), token.length);
return addLeadingZeros(date.getSeconds(), token.length);
const numberOfDigits = token.length;
const milliseconds = date.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, numberOfDigits - 3),
return addLeadingZeros(fractionalSeconds, token.length);
;// CONCATENATED MODULE: ./node_modules/date-fns/_lib/format/formatters.mjs
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
* Letters marked by * are not implemented but reserved by Unicode standard.
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
return localize.era(era, { width: "abbreviated" });
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
return localize.era(era, { width: "wide" });
y: function (date, token, localize) {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
return lightFormatters.y(date, token);
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = getWeekYear(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
const twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
return localize.ordinalNumber(weekYear, { unit: "year" });
return addLeadingZeros(weekYear, token.length);
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = getISOWeekYear(date);
return addLeadingZeros(isoWeekYear, token.length);
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return addLeadingZeros(year, token.length);
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
return addLeadingZeros(quarter, 2);
return localize.ordinalNumber(quarter, { unit: "quarter" });
return localize.quarter(quarter, {
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
return localize.quarter(quarter, {
// 1st quarter, 2nd quarter, ...
return localize.quarter(quarter, {
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
return addLeadingZeros(quarter, 2);
return localize.ordinalNumber(quarter, { unit: "quarter" });
return localize.quarter(quarter, {
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
return localize.quarter(quarter, {
// 1st quarter, 2nd quarter, ...
return localize.quarter(quarter, {
M: function (date, token, localize) {
const month = date.getMonth();
return lightFormatters.M(date, token);
return localize.ordinalNumber(month + 1, { unit: "month" });
return localize.month(month, {
return localize.month(month, {
// January, February, ..., December
return localize.month(month, { width: "wide", context: "formatting" });
L: function (date, token, localize) {
const month = date.getMonth();
return String(month + 1);
return addLeadingZeros(month + 1, 2);
return localize.ordinalNumber(month + 1, { unit: "month" });
return localize.month(month, {
return localize.month(month, {
// January, February, ..., December
return localize.month(month, { width: "wide", context: "standalone" });
w: function (date, token, localize, options) {
const week = getWeek(date, options);
return localize.ordinalNumber(week, { unit: "week" });
return addLeadingZeros(week, token.length);
I: function (date, token, localize) {
const isoWeek = getISOWeek(date);
return localize.ordinalNumber(isoWeek, { unit: "week" });
return addLeadingZeros(isoWeek, token.length);
d: function (date, token, localize) {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
return lightFormatters.d(date, token);
D: function (date, token, localize) {
const dayOfYear = getDayOfYear(date);
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
return addLeadingZeros(dayOfYear, token.length);
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
return localize.day(dayOfWeek, {