: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
// Numerical value (Nth day of week with current locale or weekStartsOn)
return String(localDayOfWeek);
// Padded numerical value
return addLeadingZeros(localDayOfWeek, 2);
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
// Numerical value (same as in `e`)
return String(localDayOfWeek);
// Padded numerical value
return addLeadingZeros(localDayOfWeek, token.length);
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
return String(isoDayOfWeek);
return addLeadingZeros(isoDayOfWeek, token.length);
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
return localize.day(dayOfWeek, {
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
return localize.dayPeriod(dayPeriodEnumValue, {
.dayPeriod(dayPeriodEnumValue, {
return localize.dayPeriod(dayPeriodEnumValue, {
return localize.dayPeriod(dayPeriodEnumValue, {
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
return localize.dayPeriod(dayPeriodEnumValue, {
.dayPeriod(dayPeriodEnumValue, {
return localize.dayPeriod(dayPeriodEnumValue, {
return localize.dayPeriod(dayPeriodEnumValue, {
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
dayPeriodEnumValue = dayPeriodEnum.morning;
dayPeriodEnumValue = dayPeriodEnum.night;
return localize.dayPeriod(dayPeriodEnumValue, {
return localize.dayPeriod(dayPeriodEnumValue, {
return localize.dayPeriod(dayPeriodEnumValue, {
h: function (date, token, localize) {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
return lightFormatters.h(date, token);
H: function (date, token, localize) {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
return lightFormatters.H(date, token);
K: function (date, token, localize) {
const hours = date.getHours() % 12;
return localize.ordinalNumber(hours, { unit: "hour" });
return addLeadingZeros(hours, token.length);
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
return localize.ordinalNumber(hours, { unit: "hour" });
return addLeadingZeros(hours, token.length);
m: function (date, token, localize) {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
return lightFormatters.m(date, token);
s: function (date, token, localize) {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
return lightFormatters.s(date, token);
S: function (date, token) {
return lightFormatters.S(date, token);
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
// Hours and optional minutes
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XX": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXX": // Hours and minutes with `:` delimiter
return formatTimezone(timezoneOffset, ":");
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
// Hours and optional minutes
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xx": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxx": // Hours and minutes with `:` delimiter
return formatTimezone(timezoneOffset, ":");
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
return "GMT" + formatTimezone(timezoneOffset, ":");
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
return "GMT" + formatTimezone(timezoneOffset, ":");
t: function (date, token, _localize) {
const timestamp = Math.trunc(date.getTime() / 1000);
return addLeadingZeros(timestamp, token.length);
// Milliseconds timestamp
T: function (date, token, _localize) {
const timestamp = date.getTime();
return addLeadingZeros(timestamp, token.length);
function formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
return sign + String(hours);
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
const sign = offset > 0 ? "-" : "+";
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
return formatTimezone(offset, delimiter);
function formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
const minutes = addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
;// CONCATENATED MODULE: ./node_modules/date-fns/_lib/format/longFormatters.mjs
const dateLongFormatter = (pattern, formatLong) => {
return formatLong.date({ width: "short" });
return formatLong.date({ width: "medium" });
return formatLong.date({ width: "long" });
return formatLong.date({ width: "full" });
const timeLongFormatter = (pattern, formatLong) => {
return formatLong.time({ width: "short" });
return formatLong.time({ width: "medium" });
return formatLong.time({ width: "long" });
return formatLong.time({ width: "full" });
const dateTimeLongFormatter = (pattern, formatLong) => {
const matchResult = pattern.match(/(P+)(p+)?/) || [];
const datePattern = matchResult[1];
const timePattern = matchResult[2];
return dateLongFormatter(pattern, formatLong);
dateTimeFormat = formatLong.dateTime({ width: "short" });
dateTimeFormat = formatLong.dateTime({ width: "medium" });
dateTimeFormat = formatLong.dateTime({ width: "long" });