: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @summary Days in 1 week.
* @summary Days in 1 year.
* How many days in a year.
* One years equals 365.2425 days according to the formula:
* > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
const daysInYear = 365.2425;
* @summary Maximum allowed time.
* import { maxTime } from "./constants/date-fns/constants";
* const isValid = 8640000000000001 <= maxTime;
* new Date(8640000000000001);
const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
* @summary Minimum allowed time.
* import { minTime } from "./constants/date-fns/constants";
* const isValid = -8640000000000001 >= minTime;
* new Date(-8640000000000001)
const minTime = -maxTime;
* @name millisecondsInWeek
* @summary Milliseconds in 1 week.
const millisecondsInWeek = 604800000;
* @name millisecondsInDay
* @summary Milliseconds in 1 day.
const millisecondsInDay = 86400000;
* @name millisecondsInMinute
* @summary Milliseconds in 1 minute
const millisecondsInMinute = 60000;
* @name millisecondsInHour
* @summary Milliseconds in 1 hour
const millisecondsInHour = 3600000;
* @name millisecondsInSecond
* @summary Milliseconds in 1 second
const millisecondsInSecond = 1000;
* @summary Minutes in 1 year.
const minutesInYear = 525600;
* @summary Minutes in 1 month.
const minutesInMonth = 43200;
* @summary Minutes in 1 day.
const minutesInDay = 1440;
* @summary Minutes in 1 hour.
const minutesInHour = 60;
* @summary Months in 1 quarter.
const monthsInQuarter = 3;
* @summary Months in 1 year.
* @summary Quarters in 1 year
const quartersInYear = 4;
* @summary Seconds in 1 hour.
const secondsInHour = 3600;
* @summary Seconds in 1 minute.
const secondsInMinute = 60;
* @summary Seconds in 1 day.
const secondsInDay = secondsInHour * 24;
* @summary Seconds in 1 week.
const secondsInWeek = secondsInDay * 7;
* @summary Seconds in 1 year.
const secondsInYear = secondsInDay * daysInYear;
* @summary Seconds in 1 month
const secondsInMonth = secondsInYear / 12;
* @summary Seconds in 1 quarter.
const secondsInQuarter = secondsInMonth * 3;
;// CONCATENATED MODULE: ./node_modules/date-fns/parseISO.mjs
* The {@link parseISO} function options.
* @category Common Helpers
* @summary Parse ISO string
* Parse the given string in ISO 8601 format and return an instance of Date.
* Function accepts complete ISO 8601 formats as well as partial implementations.
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
* If the argument isn't a string, the function cannot parse the string or
* the values are invalid, it returns Invalid 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 argument - The value to convert
* @param options - An object with options
* @returns The parsed date in the local time zone
* // Convert string '2014-02-11T11:30:30' to date:
* const result = parseISO('2014-02-11T11:30:30')
* //=> Tue Feb 11 2014 11:30:30
* // Convert string '+02014101' to date,
* // if the additional number of digits in the extended year format is 1:
* const result = parseISO('+02014101', { additionalDigits: 1 })
* //=> Fri Apr 11 2014 00:00:00
function parseISO(argument, options) {
const additionalDigits = options?.additionalDigits ?? 2;
const dateStrings = splitDateString(argument);
const parseYearResult = parseYear(dateStrings.date, additionalDigits);
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
if (!date || isNaN(date.getTime())) {
const timestamp = date.getTime();
time = parseTime(dateStrings.time);
if (dateStrings.timezone) {
offset = parseTimezone(dateStrings.timezone);
const dirtyDate = new Date(timestamp + time);
// JS parsed string assuming it's in UTC timezone
// but we need it to be parsed in our timezone
// so we use utc values to build date in our timezone.
// Year values from 0 to 99 map to the years 1900 to 1999
// so set year explicitly with setFullYear.
const result = new Date(0);
dirtyDate.getUTCFullYear(),
dirtyDate.getUTCMinutes(),
dirtyDate.getUTCSeconds(),
dirtyDate.getUTCMilliseconds(),
return new Date(timestamp + time + offset);
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function splitDateString(dateString) {
const array = dateString.split(patterns.dateTimeDelimiter);
// The regex match should only return at maximum two array elements.
// [date], [time], or [date, time].
if (/:/.test(array[0])) {
dateStrings.date = array[0];
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
timeString = dateString.substr(
const token = patterns.timezone.exec(timeString);
dateStrings.time = timeString.replace(token[1], "");
dateStrings.timezone = token[1];
dateStrings.time = timeString;
function parseYear(dateString, additionalDigits) {
const regex = new RegExp(
const captures = dateString.match(regex);
// Invalid ISO-formatted year
if (!captures) return { year: NaN, restDateString: "" };
const year = captures[1] ? parseInt(captures[1]) : null;
const century = captures[2] ? parseInt(captures[2]) : null;
// either year or century is null, not both
year: century === null ? year : century * 100,
restDateString: dateString.slice((captures[1] || captures[2]).length),
function parseDate(dateString, year) {
// Invalid ISO-formatted year
if (year === null) return new Date(NaN);
const captures = dateString.match(dateRegex);
// Invalid ISO-formatted string
if (!captures) return new Date(NaN);
const isWeekDate = !!captures[4];
const dayOfYear = parseDateUnit(captures[1]);
const month = parseDateUnit(captures[2]) - 1;
const day = parseDateUnit(captures[3]);
const week = parseDateUnit(captures[4]);
const dayOfWeek = parseDateUnit(captures[5]) - 1;
if (!validateWeekDate(year, week, dayOfWeek)) {
return dayOfISOWeekYear(year, week, dayOfWeek);
const date = new Date(0);
!validateDate(year, month, day) ||
!validateDayOfYearDate(year, dayOfYear)
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
function parseDateUnit(value) {
return value ? parseInt(value) : 1;
function parseTime(timeString) {
const captures = timeString.match(timeRegex);
if (!captures) return NaN; // Invalid ISO-formatted time
const hours = parseTimeUnit(captures[1]);
const minutes = parseTimeUnit(captures[2]);
const seconds = parseTimeUnit(captures[3]);
if (!validateTime(hours, minutes, seconds)) {
hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000
function parseTimeUnit(value) {
return (value && parseFloat(value.replace(",", "."))) || 0;
function parseTimezone(timezoneString) {
if (timezoneString === "Z") return 0;
const captures = timezoneString.match(timezoneRegex);
const sign = captures[1] === "+" ? -1 : 1;
const hours = parseInt(captures[2]);
const minutes = (captures[3] && parseInt(captures[3])) || 0;
if (!validateTimezone(hours, minutes)) {
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
function dayOfISOWeekYear(isoWeekYear, week, day) {
const date = new Date(0);
date.setUTCFullYear(isoWeekYear, 0, 4);
const fourthOfJanuaryDay = date.getUTCDay() || 7;
const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
date.setUTCDate(date.getUTCDate() + diff);
// February is null to handle the leap year (using ||)
const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function isLeapYearIndex(year) {
return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
function validateDate(year, month, date) {
date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))
function validateDayOfYearDate(year, dayOfYear) {
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
function validateWeekDate(_year, week, day) {
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
function validateTime(hours, minutes, seconds) {
return minutes === 0 && seconds === 0;
function validateTimezone(_hours, minutes) {
return minutes >= 0 && minutes <= 59;
// Fallback for modularized imports:
/* harmony default export */ const date_fns_parseISO = ((/* unused pure expression or super */ null && (parseISO)));
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js