Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: components.js
case "PPPP":
[55500] Fix | Delete
default:
[55501] Fix | Delete
dateTimeFormat = formatLong.dateTime({ width: "full" });
[55502] Fix | Delete
break;
[55503] Fix | Delete
}
[55504] Fix | Delete
[55505] Fix | Delete
return dateTimeFormat
[55506] Fix | Delete
.replace("{{date}}", dateLongFormatter(datePattern, formatLong))
[55507] Fix | Delete
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
[55508] Fix | Delete
};
[55509] Fix | Delete
[55510] Fix | Delete
const longFormatters = {
[55511] Fix | Delete
p: timeLongFormatter,
[55512] Fix | Delete
P: dateTimeLongFormatter,
[55513] Fix | Delete
};
[55514] Fix | Delete
[55515] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/date-fns/_lib/protectedTokens.mjs
[55516] Fix | Delete
const dayOfYearTokenRE = /^D+$/;
[55517] Fix | Delete
const weekYearTokenRE = /^Y+$/;
[55518] Fix | Delete
[55519] Fix | Delete
const throwTokens = ["D", "DD", "YY", "YYYY"];
[55520] Fix | Delete
[55521] Fix | Delete
function isProtectedDayOfYearToken(token) {
[55522] Fix | Delete
return dayOfYearTokenRE.test(token);
[55523] Fix | Delete
}
[55524] Fix | Delete
[55525] Fix | Delete
function isProtectedWeekYearToken(token) {
[55526] Fix | Delete
return weekYearTokenRE.test(token);
[55527] Fix | Delete
}
[55528] Fix | Delete
[55529] Fix | Delete
function warnOrThrowProtectedError(token, format, input) {
[55530] Fix | Delete
const _message = message(token, format, input);
[55531] Fix | Delete
console.warn(_message);
[55532] Fix | Delete
if (throwTokens.includes(token)) throw new RangeError(_message);
[55533] Fix | Delete
}
[55534] Fix | Delete
[55535] Fix | Delete
function message(token, format, input) {
[55536] Fix | Delete
const subject = token[0] === "Y" ? "years" : "days of the month";
[55537] Fix | Delete
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
[55538] Fix | Delete
}
[55539] Fix | Delete
[55540] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/date-fns/isDate.mjs
[55541] Fix | Delete
/**
[55542] Fix | Delete
* @name isDate
[55543] Fix | Delete
* @category Common Helpers
[55544] Fix | Delete
* @summary Is the given value a date?
[55545] Fix | Delete
*
[55546] Fix | Delete
* @description
[55547] Fix | Delete
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
[55548] Fix | Delete
*
[55549] Fix | Delete
* @param value - The value to check
[55550] Fix | Delete
*
[55551] Fix | Delete
* @returns True if the given value is a date
[55552] Fix | Delete
*
[55553] Fix | Delete
* @example
[55554] Fix | Delete
* // For a valid date:
[55555] Fix | Delete
* const result = isDate(new Date())
[55556] Fix | Delete
* //=> true
[55557] Fix | Delete
*
[55558] Fix | Delete
* @example
[55559] Fix | Delete
* // For an invalid date:
[55560] Fix | Delete
* const result = isDate(new Date(NaN))
[55561] Fix | Delete
* //=> true
[55562] Fix | Delete
*
[55563] Fix | Delete
* @example
[55564] Fix | Delete
* // For some value:
[55565] Fix | Delete
* const result = isDate('2014-02-31')
[55566] Fix | Delete
* //=> false
[55567] Fix | Delete
*
[55568] Fix | Delete
* @example
[55569] Fix | Delete
* // For an object:
[55570] Fix | Delete
* const result = isDate({})
[55571] Fix | Delete
* //=> false
[55572] Fix | Delete
*/
[55573] Fix | Delete
function isDate(value) {
[55574] Fix | Delete
return (
[55575] Fix | Delete
value instanceof Date ||
[55576] Fix | Delete
(typeof value === "object" &&
[55577] Fix | Delete
Object.prototype.toString.call(value) === "[object Date]")
[55578] Fix | Delete
);
[55579] Fix | Delete
}
[55580] Fix | Delete
[55581] Fix | Delete
// Fallback for modularized imports:
[55582] Fix | Delete
/* harmony default export */ const date_fns_isDate = ((/* unused pure expression or super */ null && (isDate)));
[55583] Fix | Delete
[55584] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/date-fns/isValid.mjs
[55585] Fix | Delete
[55586] Fix | Delete
[55587] Fix | Delete
[55588] Fix | Delete
/**
[55589] Fix | Delete
* @name isValid
[55590] Fix | Delete
* @category Common Helpers
[55591] Fix | Delete
* @summary Is the given date valid?
[55592] Fix | Delete
*
[55593] Fix | Delete
* @description
[55594] Fix | Delete
* Returns false if argument is Invalid Date and true otherwise.
[55595] Fix | Delete
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
[55596] Fix | Delete
* Invalid Date is a Date, whose time value is NaN.
[55597] Fix | Delete
*
[55598] Fix | Delete
* Time value of Date: http://es5.github.io/#x15.9.1.1
[55599] Fix | Delete
*
[55600] Fix | Delete
* @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).
[55601] Fix | Delete
*
[55602] Fix | Delete
* @param date - The date to check
[55603] Fix | Delete
*
[55604] Fix | Delete
* @returns The date is valid
[55605] Fix | Delete
*
[55606] Fix | Delete
* @example
[55607] Fix | Delete
* // For the valid date:
[55608] Fix | Delete
* const result = isValid(new Date(2014, 1, 31))
[55609] Fix | Delete
* //=> true
[55610] Fix | Delete
*
[55611] Fix | Delete
* @example
[55612] Fix | Delete
* // For the value, convertable into a date:
[55613] Fix | Delete
* const result = isValid(1393804800000)
[55614] Fix | Delete
* //=> true
[55615] Fix | Delete
*
[55616] Fix | Delete
* @example
[55617] Fix | Delete
* // For the invalid date:
[55618] Fix | Delete
* const result = isValid(new Date(''))
[55619] Fix | Delete
* //=> false
[55620] Fix | Delete
*/
[55621] Fix | Delete
function isValid(date) {
[55622] Fix | Delete
if (!isDate(date) && typeof date !== "number") {
[55623] Fix | Delete
return false;
[55624] Fix | Delete
}
[55625] Fix | Delete
const _date = toDate_toDate(date);
[55626] Fix | Delete
return !isNaN(Number(_date));
[55627] Fix | Delete
}
[55628] Fix | Delete
[55629] Fix | Delete
// Fallback for modularized imports:
[55630] Fix | Delete
/* harmony default export */ const date_fns_isValid = ((/* unused pure expression or super */ null && (isValid)));
[55631] Fix | Delete
[55632] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/date-fns/format.mjs
[55633] Fix | Delete
[55634] Fix | Delete
[55635] Fix | Delete
[55636] Fix | Delete
[55637] Fix | Delete
[55638] Fix | Delete
[55639] Fix | Delete
[55640] Fix | Delete
[55641] Fix | Delete
// Rexports of internal for libraries to use.
[55642] Fix | Delete
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
[55643] Fix | Delete
[55644] Fix | Delete
[55645] Fix | Delete
// This RegExp consists of three parts separated by `|`:
[55646] Fix | Delete
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
[55647] Fix | Delete
// (one of the certain letters followed by `o`)
[55648] Fix | Delete
// - (\w)\1* matches any sequences of the same letter
[55649] Fix | Delete
// - '' matches two quote characters in a row
[55650] Fix | Delete
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
[55651] Fix | Delete
// except a single quote symbol, which ends the sequence.
[55652] Fix | Delete
// Two quote characters do not end the sequence.
[55653] Fix | Delete
// If there is no matching single quote
[55654] Fix | Delete
// then the sequence will continue until the end of the string.
[55655] Fix | Delete
// - . matches any single character unmatched by previous parts of the RegExps
[55656] Fix | Delete
const formattingTokensRegExp =
[55657] Fix | Delete
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
[55658] Fix | Delete
[55659] Fix | Delete
// This RegExp catches symbols escaped by quotes, and also
[55660] Fix | Delete
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
[55661] Fix | Delete
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
[55662] Fix | Delete
[55663] Fix | Delete
const escapedStringRegExp = /^'([^]*?)'?$/;
[55664] Fix | Delete
const doubleQuoteRegExp = /''/g;
[55665] Fix | Delete
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
[55666] Fix | Delete
[55667] Fix | Delete
[55668] Fix | Delete
[55669] Fix | Delete
/**
[55670] Fix | Delete
* The {@link format} function options.
[55671] Fix | Delete
*/
[55672] Fix | Delete
[55673] Fix | Delete
/**
[55674] Fix | Delete
* @name format
[55675] Fix | Delete
* @alias formatDate
[55676] Fix | Delete
* @category Common Helpers
[55677] Fix | Delete
* @summary Format the date.
[55678] Fix | Delete
*
[55679] Fix | Delete
* @description
[55680] Fix | Delete
* Return the formatted date string in the given format. The result may vary by locale.
[55681] Fix | Delete
*
[55682] Fix | Delete
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
[55683] Fix | Delete
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55684] Fix | Delete
*
[55685] Fix | Delete
* The characters wrapped between two single quotes characters (') are escaped.
[55686] Fix | Delete
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
[55687] Fix | Delete
* (see the last example)
[55688] Fix | Delete
*
[55689] Fix | Delete
* Format of the string is based on Unicode Technical Standard #35:
[55690] Fix | Delete
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
[55691] Fix | Delete
* with a few additions (see note 7 below the table).
[55692] Fix | Delete
*
[55693] Fix | Delete
* Accepted patterns:
[55694] Fix | Delete
* | Unit | Pattern | Result examples | Notes |
[55695] Fix | Delete
* |---------------------------------|---------|-----------------------------------|-------|
[55696] Fix | Delete
* | Era | G..GGG | AD, BC | |
[55697] Fix | Delete
* | | GGGG | Anno Domini, Before Christ | 2 |
[55698] Fix | Delete
* | | GGGGG | A, B | |
[55699] Fix | Delete
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
[55700] Fix | Delete
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
[55701] Fix | Delete
* | | yy | 44, 01, 00, 17 | 5 |
[55702] Fix | Delete
* | | yyy | 044, 001, 1900, 2017 | 5 |
[55703] Fix | Delete
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
[55704] Fix | Delete
* | | yyyyy | ... | 3,5 |
[55705] Fix | Delete
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
[55706] Fix | Delete
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
[55707] Fix | Delete
* | | YY | 44, 01, 00, 17 | 5,8 |
[55708] Fix | Delete
* | | YYY | 044, 001, 1900, 2017 | 5 |
[55709] Fix | Delete
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
[55710] Fix | Delete
* | | YYYYY | ... | 3,5 |
[55711] Fix | Delete
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
[55712] Fix | Delete
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
[55713] Fix | Delete
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
[55714] Fix | Delete
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
[55715] Fix | Delete
* | | RRRRR | ... | 3,5,7 |
[55716] Fix | Delete
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
[55717] Fix | Delete
* | | uu | -43, 01, 1900, 2017 | 5 |
[55718] Fix | Delete
* | | uuu | -043, 001, 1900, 2017 | 5 |
[55719] Fix | Delete
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
[55720] Fix | Delete
* | | uuuuu | ... | 3,5 |
[55721] Fix | Delete
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
[55722] Fix | Delete
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
[55723] Fix | Delete
* | | QQ | 01, 02, 03, 04 | |
[55724] Fix | Delete
* | | QQQ | Q1, Q2, Q3, Q4 | |
[55725] Fix | Delete
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
[55726] Fix | Delete
* | | QQQQQ | 1, 2, 3, 4 | 4 |
[55727] Fix | Delete
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
[55728] Fix | Delete
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
[55729] Fix | Delete
* | | qq | 01, 02, 03, 04 | |
[55730] Fix | Delete
* | | qqq | Q1, Q2, Q3, Q4 | |
[55731] Fix | Delete
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
[55732] Fix | Delete
* | | qqqqq | 1, 2, 3, 4 | 4 |
[55733] Fix | Delete
* | Month (formatting) | M | 1, 2, ..., 12 | |
[55734] Fix | Delete
* | | Mo | 1st, 2nd, ..., 12th | 7 |
[55735] Fix | Delete
* | | MM | 01, 02, ..., 12 | |
[55736] Fix | Delete
* | | MMM | Jan, Feb, ..., Dec | |
[55737] Fix | Delete
* | | MMMM | January, February, ..., December | 2 |
[55738] Fix | Delete
* | | MMMMM | J, F, ..., D | |
[55739] Fix | Delete
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
[55740] Fix | Delete
* | | Lo | 1st, 2nd, ..., 12th | 7 |
[55741] Fix | Delete
* | | LL | 01, 02, ..., 12 | |
[55742] Fix | Delete
* | | LLL | Jan, Feb, ..., Dec | |
[55743] Fix | Delete
* | | LLLL | January, February, ..., December | 2 |
[55744] Fix | Delete
* | | LLLLL | J, F, ..., D | |
[55745] Fix | Delete
* | Local week of year | w | 1, 2, ..., 53 | |
[55746] Fix | Delete
* | | wo | 1st, 2nd, ..., 53th | 7 |
[55747] Fix | Delete
* | | ww | 01, 02, ..., 53 | |
[55748] Fix | Delete
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
[55749] Fix | Delete
* | | Io | 1st, 2nd, ..., 53th | 7 |
[55750] Fix | Delete
* | | II | 01, 02, ..., 53 | 7 |
[55751] Fix | Delete
* | Day of month | d | 1, 2, ..., 31 | |
[55752] Fix | Delete
* | | do | 1st, 2nd, ..., 31st | 7 |
[55753] Fix | Delete
* | | dd | 01, 02, ..., 31 | |
[55754] Fix | Delete
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
[55755] Fix | Delete
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
[55756] Fix | Delete
* | | DD | 01, 02, ..., 365, 366 | 9 |
[55757] Fix | Delete
* | | DDD | 001, 002, ..., 365, 366 | |
[55758] Fix | Delete
* | | DDDD | ... | 3 |
[55759] Fix | Delete
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
[55760] Fix | Delete
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
[55761] Fix | Delete
* | | EEEEE | M, T, W, T, F, S, S | |
[55762] Fix | Delete
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
[55763] Fix | Delete
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
[55764] Fix | Delete
* | | io | 1st, 2nd, ..., 7th | 7 |
[55765] Fix | Delete
* | | ii | 01, 02, ..., 07 | 7 |
[55766] Fix | Delete
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
[55767] Fix | Delete
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
[55768] Fix | Delete
* | | iiiii | M, T, W, T, F, S, S | 7 |
[55769] Fix | Delete
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
[55770] Fix | Delete
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
[55771] Fix | Delete
* | | eo | 2nd, 3rd, ..., 1st | 7 |
[55772] Fix | Delete
* | | ee | 02, 03, ..., 01 | |
[55773] Fix | Delete
* | | eee | Mon, Tue, Wed, ..., Sun | |
[55774] Fix | Delete
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
[55775] Fix | Delete
* | | eeeee | M, T, W, T, F, S, S | |
[55776] Fix | Delete
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
[55777] Fix | Delete
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
[55778] Fix | Delete
* | | co | 2nd, 3rd, ..., 1st | 7 |
[55779] Fix | Delete
* | | cc | 02, 03, ..., 01 | |
[55780] Fix | Delete
* | | ccc | Mon, Tue, Wed, ..., Sun | |
[55781] Fix | Delete
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
[55782] Fix | Delete
* | | ccccc | M, T, W, T, F, S, S | |
[55783] Fix | Delete
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
[55784] Fix | Delete
* | AM, PM | a..aa | AM, PM | |
[55785] Fix | Delete
* | | aaa | am, pm | |
[55786] Fix | Delete
* | | aaaa | a.m., p.m. | 2 |
[55787] Fix | Delete
* | | aaaaa | a, p | |
[55788] Fix | Delete
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
[55789] Fix | Delete
* | | bbb | am, pm, noon, midnight | |
[55790] Fix | Delete
* | | bbbb | a.m., p.m., noon, midnight | 2 |
[55791] Fix | Delete
* | | bbbbb | a, p, n, mi | |
[55792] Fix | Delete
* | Flexible day period | B..BBB | at night, in the morning, ... | |
[55793] Fix | Delete
* | | BBBB | at night, in the morning, ... | 2 |
[55794] Fix | Delete
* | | BBBBB | at night, in the morning, ... | |
[55795] Fix | Delete
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
[55796] Fix | Delete
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
[55797] Fix | Delete
* | | hh | 01, 02, ..., 11, 12 | |
[55798] Fix | Delete
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
[55799] Fix | Delete
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
[55800] Fix | Delete
* | | HH | 00, 01, 02, ..., 23 | |
[55801] Fix | Delete
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
[55802] Fix | Delete
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
[55803] Fix | Delete
* | | KK | 01, 02, ..., 11, 00 | |
[55804] Fix | Delete
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
[55805] Fix | Delete
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
[55806] Fix | Delete
* | | kk | 24, 01, 02, ..., 23 | |
[55807] Fix | Delete
* | Minute | m | 0, 1, ..., 59 | |
[55808] Fix | Delete
* | | mo | 0th, 1st, ..., 59th | 7 |
[55809] Fix | Delete
* | | mm | 00, 01, ..., 59 | |
[55810] Fix | Delete
* | Second | s | 0, 1, ..., 59 | |
[55811] Fix | Delete
* | | so | 0th, 1st, ..., 59th | 7 |
[55812] Fix | Delete
* | | ss | 00, 01, ..., 59 | |
[55813] Fix | Delete
* | Fraction of second | S | 0, 1, ..., 9 | |
[55814] Fix | Delete
* | | SS | 00, 01, ..., 99 | |
[55815] Fix | Delete
* | | SSS | 000, 001, ..., 999 | |
[55816] Fix | Delete
* | | SSSS | ... | 3 |
[55817] Fix | Delete
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
[55818] Fix | Delete
* | | XX | -0800, +0530, Z | |
[55819] Fix | Delete
* | | XXX | -08:00, +05:30, Z | |
[55820] Fix | Delete
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
[55821] Fix | Delete
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
[55822] Fix | Delete
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
[55823] Fix | Delete
* | | xx | -0800, +0530, +0000 | |
[55824] Fix | Delete
* | | xxx | -08:00, +05:30, +00:00 | 2 |
[55825] Fix | Delete
* | | xxxx | -0800, +0530, +0000, +123456 | |
[55826] Fix | Delete
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
[55827] Fix | Delete
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
[55828] Fix | Delete
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
[55829] Fix | Delete
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
[55830] Fix | Delete
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
[55831] Fix | Delete
* | Seconds timestamp | t | 512969520 | 7 |
[55832] Fix | Delete
* | | tt | ... | 3,7 |
[55833] Fix | Delete
* | Milliseconds timestamp | T | 512969520900 | 7 |
[55834] Fix | Delete
* | | TT | ... | 3,7 |
[55835] Fix | Delete
* | Long localized date | P | 04/29/1453 | 7 |
[55836] Fix | Delete
* | | PP | Apr 29, 1453 | 7 |
[55837] Fix | Delete
* | | PPP | April 29th, 1453 | 7 |
[55838] Fix | Delete
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
[55839] Fix | Delete
* | Long localized time | p | 12:00 AM | 7 |
[55840] Fix | Delete
* | | pp | 12:00:00 AM | 7 |
[55841] Fix | Delete
* | | ppp | 12:00:00 AM GMT+2 | 7 |
[55842] Fix | Delete
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
[55843] Fix | Delete
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
[55844] Fix | Delete
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
[55845] Fix | Delete
* | | PPPppp | April 29th, 1453 at ... | 7 |
[55846] Fix | Delete
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
[55847] Fix | Delete
* Notes:
[55848] Fix | Delete
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
[55849] Fix | Delete
* are the same as "stand-alone" units, but are different in some languages.
[55850] Fix | Delete
* "Formatting" units are declined according to the rules of the language
[55851] Fix | Delete
* in the context of a date. "Stand-alone" units are always nominative singular:
[55852] Fix | Delete
*
[55853] Fix | Delete
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
[55854] Fix | Delete
*
[55855] Fix | Delete
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
[55856] Fix | Delete
*
[55857] Fix | Delete
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
[55858] Fix | Delete
* the single quote characters (see below).
[55859] Fix | Delete
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
[55860] Fix | Delete
* the output will be the same as default pattern for this unit, usually
[55861] Fix | Delete
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
[55862] Fix | Delete
* are marked with "2" in the last column of the table.
[55863] Fix | Delete
*
[55864] Fix | Delete
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
[55865] Fix | Delete
*
[55866] Fix | Delete
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
[55867] Fix | Delete
*
[55868] Fix | Delete
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
[55869] Fix | Delete
*
[55870] Fix | Delete
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
[55871] Fix | Delete
*
[55872] Fix | Delete
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
[55873] Fix | Delete
*
[55874] Fix | Delete
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
[55875] Fix | Delete
* The output will be padded with zeros to match the length of the pattern.
[55876] Fix | Delete
*
[55877] Fix | Delete
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
[55878] Fix | Delete
*
[55879] Fix | Delete
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
[55880] Fix | Delete
* These tokens represent the shortest form of the quarter.
[55881] Fix | Delete
*
[55882] Fix | Delete
* 5. The main difference between `y` and `u` patterns are B.C. years:
[55883] Fix | Delete
*
[55884] Fix | Delete
* | Year | `y` | `u` |
[55885] Fix | Delete
* |------|-----|-----|
[55886] Fix | Delete
* | AC 1 | 1 | 1 |
[55887] Fix | Delete
* | BC 1 | 1 | 0 |
[55888] Fix | Delete
* | BC 2 | 2 | -1 |
[55889] Fix | Delete
*
[55890] Fix | Delete
* Also `yy` always returns the last two digits of a year,
[55891] Fix | Delete
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
[55892] Fix | Delete
*
[55893] Fix | Delete
* | Year | `yy` | `uu` |
[55894] Fix | Delete
* |------|------|------|
[55895] Fix | Delete
* | 1 | 01 | 01 |
[55896] Fix | Delete
* | 14 | 14 | 14 |
[55897] Fix | Delete
* | 376 | 76 | 376 |
[55898] Fix | Delete
* | 1453 | 53 | 1453 |
[55899] Fix | Delete
*
[55900] Fix | Delete
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
[55901] Fix | Delete
* except local week-numbering years are dependent on `options.weekStartsOn`
[55902] Fix | Delete
* and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
[55903] Fix | Delete
* and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
[55904] Fix | Delete
*
[55905] Fix | Delete
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
[55906] Fix | Delete
* so right now these tokens fall back to GMT timezones.
[55907] Fix | Delete
*
[55908] Fix | Delete
* 7. These patterns are not in the Unicode Technical Standard #35:
[55909] Fix | Delete
* - `i`: ISO day of week
[55910] Fix | Delete
* - `I`: ISO week of year
[55911] Fix | Delete
* - `R`: ISO week-numbering year
[55912] Fix | Delete
* - `t`: seconds timestamp
[55913] Fix | Delete
* - `T`: milliseconds timestamp
[55914] Fix | Delete
* - `o`: ordinal number modifier
[55915] Fix | Delete
* - `P`: long localized date
[55916] Fix | Delete
* - `p`: long localized time
[55917] Fix | Delete
*
[55918] Fix | Delete
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
[55919] Fix | Delete
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55920] Fix | Delete
*
[55921] Fix | Delete
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
[55922] Fix | Delete
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55923] Fix | Delete
*
[55924] Fix | Delete
* @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).
[55925] Fix | Delete
*
[55926] Fix | Delete
* @param date - The original date
[55927] Fix | Delete
* @param format - The string of tokens
[55928] Fix | Delete
* @param options - An object with options
[55929] Fix | Delete
*
[55930] Fix | Delete
* @returns The formatted date string
[55931] Fix | Delete
*
[55932] Fix | Delete
* @throws `date` must not be Invalid Date
[55933] Fix | Delete
* @throws `options.locale` must contain `localize` property
[55934] Fix | Delete
* @throws `options.locale` must contain `formatLong` property
[55935] Fix | Delete
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55936] Fix | Delete
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55937] Fix | Delete
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55938] Fix | Delete
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
[55939] Fix | Delete
* @throws format string contains an unescaped latin alphabet character
[55940] Fix | Delete
*
[55941] Fix | Delete
* @example
[55942] Fix | Delete
* // Represent 11 February 2014 in middle-endian format:
[55943] Fix | Delete
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
[55944] Fix | Delete
* //=> '02/11/2014'
[55945] Fix | Delete
*
[55946] Fix | Delete
* @example
[55947] Fix | Delete
* // Represent 2 July 2014 in Esperanto:
[55948] Fix | Delete
* import { eoLocale } from 'date-fns/locale/eo'
[55949] Fix | Delete
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
[55950] Fix | Delete
* locale: eoLocale
[55951] Fix | Delete
* })
[55952] Fix | Delete
* //=> '2-a de julio 2014'
[55953] Fix | Delete
*
[55954] Fix | Delete
* @example
[55955] Fix | Delete
* // Escape string by single quote characters:
[55956] Fix | Delete
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
[55957] Fix | Delete
* //=> "3 o'clock"
[55958] Fix | Delete
*/
[55959] Fix | Delete
function format(date, formatStr, options) {
[55960] Fix | Delete
const defaultOptions = defaultOptions_getDefaultOptions();
[55961] Fix | Delete
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
[55962] Fix | Delete
[55963] Fix | Delete
const firstWeekContainsDate =
[55964] Fix | Delete
options?.firstWeekContainsDate ??
[55965] Fix | Delete
options?.locale?.options?.firstWeekContainsDate ??
[55966] Fix | Delete
defaultOptions.firstWeekContainsDate ??
[55967] Fix | Delete
defaultOptions.locale?.options?.firstWeekContainsDate ??
[55968] Fix | Delete
1;
[55969] Fix | Delete
[55970] Fix | Delete
const weekStartsOn =
[55971] Fix | Delete
options?.weekStartsOn ??
[55972] Fix | Delete
options?.locale?.options?.weekStartsOn ??
[55973] Fix | Delete
defaultOptions.weekStartsOn ??
[55974] Fix | Delete
defaultOptions.locale?.options?.weekStartsOn ??
[55975] Fix | Delete
0;
[55976] Fix | Delete
[55977] Fix | Delete
const originalDate = toDate_toDate(date);
[55978] Fix | Delete
[55979] Fix | Delete
if (!isValid(originalDate)) {
[55980] Fix | Delete
throw new RangeError("Invalid time value");
[55981] Fix | Delete
}
[55982] Fix | Delete
[55983] Fix | Delete
let parts = formatStr
[55984] Fix | Delete
.match(longFormattingTokensRegExp)
[55985] Fix | Delete
.map((substring) => {
[55986] Fix | Delete
const firstCharacter = substring[0];
[55987] Fix | Delete
if (firstCharacter === "p" || firstCharacter === "P") {
[55988] Fix | Delete
const longFormatter = longFormatters[firstCharacter];
[55989] Fix | Delete
return longFormatter(substring, locale.formatLong);
[55990] Fix | Delete
}
[55991] Fix | Delete
return substring;
[55992] Fix | Delete
})
[55993] Fix | Delete
.join("")
[55994] Fix | Delete
.match(formattingTokensRegExp)
[55995] Fix | Delete
.map((substring) => {
[55996] Fix | Delete
// Replace two single quote characters with one single quote character
[55997] Fix | Delete
if (substring === "''") {
[55998] Fix | Delete
return { isToken: false, value: "'" };
[55999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function