@wordpress/date
Advanced tools
Comparing version 2.2.1 to 3.0.0
@@ -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 @@ /** |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97501
1163
1