@wordpress/date
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -5,4 +5,5 @@ /** | ||
import momentLib from 'moment'; | ||
import 'moment-timezone'; | ||
import 'moment-timezone/moment-timezone-utils'; // Changes made here will likely need to be made in `lib/client-assets.php` as | ||
import 'moment-timezone/moment-timezone'; | ||
import 'moment-timezone/moment-timezone-utils'; | ||
var WP_ZONE = 'WP'; // 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,4 +106,4 @@ | ||
momentLib.tz.add(momentLib.tz.pack({ | ||
name: 'WP', | ||
abbrs: ['WP'], | ||
name: WP_ZONE, | ||
abbrs: [WP_ZONE], | ||
untils: [null], | ||
@@ -390,4 +391,4 @@ offsets: [-settings.timezone.offset * 60 || 0] | ||
export function isInTheFuture(dateValue) { | ||
var now = momentLib.tz('WP'); | ||
var momentObject = momentLib.tz(dateValue, 'WP'); | ||
var now = momentLib.tz(WP_ZONE); | ||
var momentObject = momentLib.tz(dateValue, WP_ZONE); | ||
return momentObject.isAfter(now); | ||
@@ -405,8 +406,8 @@ } | ||
if (!dateString) { | ||
return momentLib.tz('WP').toDate(); | ||
return momentLib.tz(WP_ZONE).toDate(); | ||
} | ||
return momentLib.tz(dateString, 'WP').toDate(); | ||
return momentLib.tz(dateString, WP_ZONE).toDate(); | ||
} | ||
setupWPTimezone(); | ||
//# sourceMappingURL=index.js.map |
@@ -19,3 +19,3 @@ "use strict"; | ||
require("moment-timezone"); | ||
require("moment-timezone/moment-timezone"); | ||
@@ -27,4 +27,5 @@ require("moment-timezone/moment-timezone-utils"); | ||
*/ | ||
// Changes made here will likely need to be made in `lib/client-assets.php` as | ||
var WP_ZONE = 'WP'; // 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. | ||
var settings = { | ||
@@ -129,4 +130,4 @@ l10n: { | ||
_moment.default.tz.add(_moment.default.tz.pack({ | ||
name: 'WP', | ||
abbrs: ['WP'], | ||
name: WP_ZONE, | ||
abbrs: [WP_ZONE], | ||
untils: [null], | ||
@@ -418,5 +419,5 @@ offsets: [-settings.timezone.offset * 60 || 0] | ||
function isInTheFuture(dateValue) { | ||
var now = _moment.default.tz('WP'); | ||
var now = _moment.default.tz(WP_ZONE); | ||
var momentObject = _moment.default.tz(dateValue, 'WP'); | ||
var momentObject = _moment.default.tz(dateValue, WP_ZONE); | ||
@@ -436,6 +437,6 @@ return momentObject.isAfter(now); | ||
if (!dateString) { | ||
return _moment.default.tz('WP').toDate(); | ||
return _moment.default.tz(WP_ZONE).toDate(); | ||
} | ||
return _moment.default.tz(dateString, 'WP').toDate(); | ||
return _moment.default.tz(dateString, WP_ZONE).toDate(); | ||
} | ||
@@ -442,0 +443,0 @@ |
@@ -1,2 +0,2 @@ | ||
## 3.0.0 (Unreleased) | ||
## 3.0.0 (2018-11-15) | ||
@@ -3,0 +3,0 @@ ### Breaking Changes |
{ | ||
"name": "@wordpress/date", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Date module for WordPress.", | ||
@@ -30,3 +30,3 @@ "author": "The WordPress Contributors", | ||
}, | ||
"gitHead": "a177dd725495d102d24aee87394c724985bd9f72" | ||
"gitHead": "e7e72e1a211f8426cb136c86d2948f497a03e1e4" | ||
} |
@@ -5,5 +5,7 @@ /** | ||
import momentLib from 'moment'; | ||
import 'moment-timezone'; | ||
import 'moment-timezone/moment-timezone'; | ||
import 'moment-timezone/moment-timezone-utils'; | ||
const WP_ZONE = 'WP'; | ||
// Changes made here will likely need to be made in `lib/client-assets.php` as | ||
@@ -96,4 +98,4 @@ // well because it uses the `setSettings()` function to change these settings. | ||
momentLib.tz.add( momentLib.tz.pack( { | ||
name: 'WP', | ||
abbrs: [ 'WP' ], | ||
name: WP_ZONE, | ||
abbrs: [ WP_ZONE ], | ||
untils: [ null ], | ||
@@ -376,4 +378,4 @@ offsets: [ -settings.timezone.offset * 60 || 0 ], | ||
export function isInTheFuture( dateValue ) { | ||
const now = momentLib.tz( 'WP' ); | ||
const momentObject = momentLib.tz( dateValue, 'WP' ); | ||
const now = momentLib.tz( WP_ZONE ); | ||
const momentObject = momentLib.tz( dateValue, WP_ZONE ); | ||
@@ -392,8 +394,8 @@ return momentObject.isAfter( now ); | ||
if ( ! dateString ) { | ||
return momentLib.tz( 'WP' ).toDate(); | ||
return momentLib.tz( WP_ZONE ).toDate(); | ||
} | ||
return momentLib.tz( dateString, 'WP' ).toDate(); | ||
return momentLib.tz( dateString, WP_ZONE ).toDate(); | ||
} | ||
setupWPTimezone(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
97894
1165
0