diff --git a/Gruntfile.js b/Gruntfile.js index 7af9090a1d..54c041aa41 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -748,6 +748,10 @@ module.exports = function(grunt) { src: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js', dest: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js' }, + moment: { + src: WORKING_DIR + 'wp-includes/js/dist/vendor/moment.js', + dest: WORKING_DIR + 'wp-includes/js/dist/vendor/moment.min.js' + }, dynamic: { expand: true, cwd: WORKING_DIR, @@ -1222,6 +1226,7 @@ module.exports = function(grunt) { 'jshint:corejs', 'uglify:imgareaselect', 'uglify:jqueryform', + 'uglify:moment', 'qunit:compiled' ] ); @@ -1362,7 +1367,8 @@ module.exports = function(grunt) { 'uglify:embed', 'uglify:jqueryui', 'uglify:imgareaselect', - 'uglify:jqueryform' + 'uglify:jqueryform', + 'uglify:moment' ] ); grunt.registerTask( 'build:webpack', [ diff --git a/package-lock.json b/package-lock.json index 871958d8c7..a3aaa6967d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17213,9 +17213,9 @@ } }, "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", + "integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==" }, "moment-timezone": { "version": "0.5.28", diff --git a/package.json b/package.json index 0557725406..379580fe49 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "jquery-ui": "https://github.com/jquery/jquery-ui/archive/1.11.4.tar.gz", "lodash": "4.17.15", "masonry-layout": "4.2.2", - "moment": "2.22.2", + "moment": "2.26.0", "polyfill-library": "3.42.0", "react": "16.9.0", "react-dom": "16.9.0", diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index a6a8e6d8ce..27fac092cf 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -95,7 +95,7 @@ function wp_default_packages_vendor( $scripts ) { $vendor_scripts_versions = array( 'react' => '16.9.0', 'react-dom' => '16.9.0', - 'moment' => '2.22.2', + 'moment' => '2.26.0', 'lodash' => '4.17.15', 'wp-polyfill-fetch' => '3.0.0', 'wp-polyfill-formdata' => '3.0.12', @@ -139,7 +139,7 @@ function wp_default_packages_vendor( $scripts ) { did_action( 'init' ) && $scripts->add_inline_script( 'moment', sprintf( - "moment.locale( '%s', %s );", + "moment.updateLocale( '%s', %s );", get_user_locale(), wp_json_encode( array(