New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/date

Package Overview
Dependencies
Maintainers
25
Versions
170
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 4.41.1-next.5a1d1283.0 to 4.42.0

30

build-module/index.js

@@ -194,9 +194,25 @@ /**

function setupWPTimezone() {
// Create WP timezone based off dateSettings.
momentLib.tz.add(momentLib.tz.pack({
name: WP_ZONE,
abbrs: [WP_ZONE],
untils: [null],
offsets: [-settings.timezone.offset * 60 || 0]
}));
// Get the current timezone settings from the WP timezone string.
const currentTimezone = momentLib.tz.zone(settings.timezone.string);
// Check to see if we have a valid TZ data, if so, use it for the custom WP_ZONE timezone, otherwise just use the offset.
if (currentTimezone) {
// Create WP timezone based off settings.timezone.string. We need to include the additional data so that we
// don't lose information about daylight savings time and other items.
// See https://github.com/WordPress/gutenberg/pull/48083
momentLib.tz.add(momentLib.tz.pack({
name: WP_ZONE,
abbrs: currentTimezone.abbrs,
untils: currentTimezone.untils,
offsets: currentTimezone.offsets
}));
} else {
// Create WP timezone based off dateSettings.
momentLib.tz.add(momentLib.tz.pack({
name: WP_ZONE,
abbrs: [WP_ZONE],
untils: [null],
offsets: [-settings.timezone.offset * 60 || 0]
}));
}
}

@@ -203,0 +219,0 @@

@@ -211,9 +211,25 @@ "use strict";

function setupWPTimezone() {
// Create WP timezone based off dateSettings.
_moment.default.tz.add(_moment.default.tz.pack({
name: WP_ZONE,
abbrs: [WP_ZONE],
untils: [null],
offsets: [-settings.timezone.offset * 60 || 0]
}));
// Get the current timezone settings from the WP timezone string.
const currentTimezone = _moment.default.tz.zone(settings.timezone.string);
// Check to see if we have a valid TZ data, if so, use it for the custom WP_ZONE timezone, otherwise just use the offset.
if (currentTimezone) {
// Create WP timezone based off settings.timezone.string. We need to include the additional data so that we
// don't lose information about daylight savings time and other items.
// See https://github.com/WordPress/gutenberg/pull/48083
_moment.default.tz.add(_moment.default.tz.pack({
name: WP_ZONE,
abbrs: currentTimezone.abbrs,
untils: currentTimezone.untils,
offsets: currentTimezone.offsets
}));
} else {
// Create WP timezone based off dateSettings.
_moment.default.tz.add(_moment.default.tz.pack({
name: WP_ZONE,
abbrs: [WP_ZONE],
untils: [null],
offsets: [-settings.timezone.offset * 60 || 0]
}));
}
}

@@ -220,0 +236,0 @@

@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## 4.42.0 (2023-09-20)
## 4.41.0 (2023-08-31)

@@ -7,0 +9,0 @@

{
"name": "@wordpress/date",
"version": "4.41.1-next.5a1d1283.0",
"version": "4.42.0",
"description": "Date module for WordPress.",

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

"@babel/runtime": "^7.16.0",
"@wordpress/deprecated": "^3.41.1-next.5a1d1283.0",
"@wordpress/deprecated": "^3.42.0",
"moment": "^2.29.4",

@@ -38,3 +38,3 @@ "moment-timezone": "^0.5.40"

},
"gitHead": "fa0b66987dab5a15f38663e06036d09bccffaa4b"
"gitHead": "cc35f517ed017ab7131319af3e87c359e8de175d"
}

@@ -229,11 +229,29 @@ /**

function setupWPTimezone() {
// Create WP timezone based off dateSettings.
momentLib.tz.add(
momentLib.tz.pack( {
name: WP_ZONE,
abbrs: [ WP_ZONE ],
untils: [ null ],
offsets: [ -settings.timezone.offset * 60 || 0 ],
} )
);
// Get the current timezone settings from the WP timezone string.
const currentTimezone = momentLib.tz.zone( settings.timezone.string );
// Check to see if we have a valid TZ data, if so, use it for the custom WP_ZONE timezone, otherwise just use the offset.
if ( currentTimezone ) {
// Create WP timezone based off settings.timezone.string. We need to include the additional data so that we
// don't lose information about daylight savings time and other items.
// See https://github.com/WordPress/gutenberg/pull/48083
momentLib.tz.add(
momentLib.tz.pack( {
name: WP_ZONE,
abbrs: currentTimezone.abbrs,
untils: currentTimezone.untils,
offsets: currentTimezone.offsets,
} )
);
} else {
// Create WP timezone based off dateSettings.
momentLib.tz.add(
momentLib.tz.pack( {
name: WP_ZONE,
abbrs: [ WP_ZONE ],
untils: [ null ],
offsets: [ -settings.timezone.offset * 60 || 0 ],
} )
);
}
}

@@ -240,0 +258,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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