Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/date

Package Overview
Dependencies
Maintainers
8
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/date - npm Package Compare versions

Comparing version 2.2.1 to 3.0.0

37

build-module/index.js

@@ -6,8 +6,3 @@ /**

import 'moment-timezone';
import 'moment-timezone/moment-timezone-utils';
/**
* WordPress dependencies
*/
import deprecated from '@wordpress/deprecated'; // Changes made here will likely need to be made in `lib/client-assets.php` as
import 'moment-timezone/moment-timezone-utils'; // Changes made here will likely need to be made in `lib/client-assets.php` as
// well because it uses the `setSettings()` function to change these settings.

@@ -105,12 +100,2 @@

return settings;
} // deprecations
export function getSettings() {
deprecated('wp.date.getSettings', {
version: '4.4',
alternative: 'wp.date.__experimentalGetSettings',
plugin: 'Gutenberg',
hint: 'Unstable APIs are strongly discouraged to be used, and are subject to removal without notice.'
});
return settings;
}

@@ -126,21 +111,4 @@

}));
} // Create a new moment object which mirrors moment but includes
// the attached timezone, instead of setting a default timezone on
// the global moment object.
} // Date constants.
export var moment = function moment() {
deprecated('wp.date.moment', {
version: '4.4',
alternative: 'the moment script as a dependency',
plugin: 'Gutenberg'
});
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return momentLib.tz.apply(momentLib, args.concat(['WP']));
}; // Date constants.
/**

@@ -152,2 +120,3 @@ * Number of seconds in one minute.

var MINUTE_IN_SECONDS = 60;

@@ -154,0 +123,0 @@ /**

@@ -10,3 +10,2 @@ "use strict";

exports.__experimentalGetSettings = __experimentalGetSettings;
exports.getSettings = getSettings;
exports.format = format;

@@ -18,3 +17,2 @@ exports.date = date;

exports.getDate = getDate;
exports.moment = void 0;

@@ -27,11 +25,5 @@ var _moment = _interopRequireDefault(require("moment"));

var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
// Changes made here will likely need to be made in `lib/client-assets.php` as

@@ -133,13 +125,2 @@ // well because it uses the `setSettings()` function to change these settings.

return settings;
} // deprecations
function getSettings() {
(0, _deprecated.default)('wp.date.getSettings', {
version: '4.4',
alternative: 'wp.date.__experimentalGetSettings',
plugin: 'Gutenberg',
hint: 'Unstable APIs are strongly discouraged to be used, and are subject to removal without notice.'
});
return settings;
}

@@ -155,21 +136,4 @@

}));
} // Create a new moment object which mirrors moment but includes
// the attached timezone, instead of setting a default timezone on
// the global moment object.
} // Date constants.
var moment = function moment() {
(0, _deprecated.default)('wp.date.moment', {
version: '4.4',
alternative: 'the moment script as a dependency',
plugin: 'Gutenberg'
});
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _moment.default.tz.apply(_moment.default, args.concat(['WP']));
}; // Date constants.
/**

@@ -182,3 +146,2 @@ * Number of seconds in one minute.

exports.moment = moment;
var MINUTE_IN_SECONDS = 60;

@@ -185,0 +148,0 @@ /**

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## 3.0.0 (Unreleased)
### Breaking Changes
- `getSettings` has been removed. Please use `__experimentalGetSettings` instead.
- `moment` has been removed from the public API for the date module.
## 2.2.1 (2018-11-09)

@@ -2,0 +9,0 @@

{
"name": "@wordpress/date",
"version": "2.2.1",
"version": "3.0.0",
"description": "Date module for WordPress.",

@@ -30,3 +30,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "665ac6de67e026b296d24473e4322049d8c06268"
"gitHead": "a177dd725495d102d24aee87394c724985bd9f72"
}

@@ -8,7 +8,2 @@ /**

/**
* WordPress dependencies
*/
import deprecated from '@wordpress/deprecated';
// Changes made here will likely need to be made in `lib/client-assets.php` as

@@ -98,13 +93,2 @@ // well because it uses the `setSettings()` function to change these settings.

// deprecations
export function getSettings() {
deprecated( 'wp.date.getSettings', {
version: '4.4',
alternative: 'wp.date.__experimentalGetSettings',
plugin: 'Gutenberg',
hint: 'Unstable APIs are strongly discouraged to be used, and are subject to removal without notice.',
} );
return settings;
}
function setupWPTimezone() {

@@ -120,15 +104,2 @@ // Create WP timezone based off dateSettings.

// Create a new moment object which mirrors moment but includes
// the attached timezone, instead of setting a default timezone on
// the global moment object.
export const moment = ( ...args ) => {
deprecated( 'wp.date.moment', {
version: '4.4',
alternative: 'the moment script as a dependency',
plugin: 'Gutenberg',
} );
return momentLib.tz( ...args, 'WP' );
};
// Date constants.

@@ -135,0 +106,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc