External Libraries: Update `Moment.js` to the latest version.

This updates the `moment` script from version `2.27.0` to `2.29.1`.

Props shital-patel, hareesh-pillai.
Fixes #52853.
Built from https://develop.svn.wordpress.org/trunk@50773


git-svn-id: http://core.svn.wordpress.org/trunk@50382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-04-20 19:15:21 +00:00
parent 253e1e0413
commit 9d2315b409
4 changed files with 14 additions and 12 deletions

View File

@ -1,5 +1,5 @@
//! moment.js
//! version : 2.27.0
//! version : 2.29.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
@ -2540,8 +2540,7 @@
hooks.createFromInputFallback = deprecate(
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
'discouraged and will be removed in an upcoming major release. Please refer to ' +
'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
}
@ -3726,7 +3725,10 @@
function calendar$1(time, formats) {
// Support for single parameter, formats only overload to the calendar function
if (arguments.length === 1) {
if (isMomentInput(arguments[0])) {
if (!arguments[0]) {
time = undefined;
formats = undefined;
} else if (isMomentInput(arguments[0])) {
time = arguments[0];
formats = undefined;
} else if (isCalendarSpec(arguments[0])) {
@ -4404,7 +4406,7 @@
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
// truncate time
val = this.startOf('day').valueOf();
val = this.clone().startOf('day').valueOf();
if (eras[i].since <= val && val <= eras[i].until) {
return eras[i].name;
@ -4424,7 +4426,7 @@
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
// truncate time
val = this.startOf('day').valueOf();
val = this.clone().startOf('day').valueOf();
if (eras[i].since <= val && val <= eras[i].until) {
return eras[i].narrow;
@ -4444,7 +4446,7 @@
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
// truncate time
val = this.startOf('day').valueOf();
val = this.clone().startOf('day').valueOf();
if (eras[i].since <= val && val <= eras[i].until) {
return eras[i].abbr;
@ -4467,7 +4469,7 @@
dir = eras[i].since <= eras[i].until ? +1 : -1;
// truncate time
val = this.startOf('day').valueOf();
val = this.clone().startOf('day').valueOf();
if (
(eras[i].since <= val && val <= eras[i].until) ||
@ -5618,7 +5620,7 @@
//! moment.js
hooks.version = '2.27.0';
hooks.version = '2.29.1';
setHookCallback(createLocal);

File diff suppressed because one or more lines are too long

View File

@ -97,7 +97,7 @@ function wp_default_packages_vendor( $scripts ) {
$vendor_scripts_versions = array(
'react' => '16.13.1',
'react-dom' => '16.13.1',
'moment' => '2.26.0',
'moment' => '2.29.1',
'lodash' => '4.17.19',
'wp-polyfill-fetch' => '3.0.0',
'wp-polyfill-formdata' => '3.0.20',

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50772';
$wp_version = '5.8-alpha-50773';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.