@wordpress/date 5.33.1 → 5.34.1-next.2f1c7c01b.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/index.js +9 -7
- package/build/index.js.map +1 -1
- package/build/types.js +2 -0
- package/build/types.js.map +1 -1
- package/build-module/index.js +8 -7
- package/build-module/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/build/index.js
CHANGED
|
@@ -27,6 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// packages/date/src/index.ts
|
|
30
32
|
var index_exports = {};
|
|
31
33
|
__export(index_exports, {
|
|
32
34
|
__experimentalGetSettings: () => __experimentalGetSettings,
|
|
@@ -47,9 +49,9 @@ var import_moment_timezone = require("moment-timezone/moment-timezone");
|
|
|
47
49
|
var import_moment_timezone_utils = require("moment-timezone/moment-timezone-utils");
|
|
48
50
|
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
49
51
|
__reExport(index_exports, require("./types"), module.exports);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
var WP_ZONE = "WP";
|
|
53
|
+
var VALID_UTC_OFFSET = /^[+-][0-1][0-9](:?[0-9][0-9])?$/;
|
|
54
|
+
var settings = {
|
|
53
55
|
l10n: {
|
|
54
56
|
locale: "en",
|
|
55
57
|
months: [
|
|
@@ -188,10 +190,10 @@ function setupWPTimezone() {
|
|
|
188
190
|
);
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
var MINUTE_IN_SECONDS = 60;
|
|
194
|
+
var HOUR_IN_MINUTES = 60;
|
|
195
|
+
var HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
|
|
196
|
+
var formatMap = {
|
|
195
197
|
// Day.
|
|
196
198
|
d: "DD",
|
|
197
199
|
D: "ddd",
|
package/build/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Moment } from 'moment';\nimport momentLib from 'moment';\nimport 'moment-timezone/moment-timezone';\nimport 'moment-timezone/moment-timezone-utils';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { DateSettings } from './types';\n\nexport * from './types';\n\nconst WP_ZONE = 'WP';\n\n// This regular expression tests positive for UTC offsets as described in ISO 8601.\n// See: https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\nconst VALID_UTC_OFFSET = /^[+-][0-1][0-9](:?[0-9][0-9])?$/;\n\n// Changes made here will likely need to be synced with Core in the file\n// src/wp-includes/script-loader.php in `wp_default_packages_inline_scripts()`.\nlet settings: DateSettings = {\n\tl10n: {\n\t\tlocale: 'en',\n\t\tmonths: [\n\t\t\t'January',\n\t\t\t'February',\n\t\t\t'March',\n\t\t\t'April',\n\t\t\t'May',\n\t\t\t'June',\n\t\t\t'July',\n\t\t\t'August',\n\t\t\t'September',\n\t\t\t'October',\n\t\t\t'November',\n\t\t\t'December',\n\t\t],\n\t\tmonthsShort: [\n\t\t\t'Jan',\n\t\t\t'Feb',\n\t\t\t'Mar',\n\t\t\t'Apr',\n\t\t\t'May',\n\t\t\t'Jun',\n\t\t\t'Jul',\n\t\t\t'Aug',\n\t\t\t'Sep',\n\t\t\t'Oct',\n\t\t\t'Nov',\n\t\t\t'Dec',\n\t\t],\n\t\tweekdays: [\n\t\t\t'Sunday',\n\t\t\t'Monday',\n\t\t\t'Tuesday',\n\t\t\t'Wednesday',\n\t\t\t'Thursday',\n\t\t\t'Friday',\n\t\t\t'Saturday',\n\t\t],\n\t\tweekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],\n\t\tmeridiem: { am: 'am', pm: 'pm', AM: 'AM', PM: 'PM' },\n\t\trelative: {\n\t\t\tfuture: '%s from now',\n\t\t\tpast: '%s ago',\n\t\t\ts: 'a few seconds',\n\t\t\tss: '%d seconds',\n\t\t\tm: 'a minute',\n\t\t\tmm: '%d minutes',\n\t\t\th: 'an hour',\n\t\t\thh: '%d hours',\n\t\t\td: 'a day',\n\t\t\tdd: '%d days',\n\t\t\tM: 'a month',\n\t\t\tMM: '%d months',\n\t\t\ty: 'a year',\n\t\t\tyy: '%d years',\n\t\t},\n\t\tstartOfWeek: 0,\n\t},\n\tformats: {\n\t\ttime: 'g: i a',\n\t\tdate: 'F j, Y',\n\t\tdatetime: 'F j, Y g: i a',\n\t\tdatetimeAbbreviated: 'M j, Y g: i a',\n\t},\n\ttimezone: { offset: '0', offsetFormatted: '0', string: '', abbr: '' },\n};\n\n/**\n * Adds a locale to moment, using the format supplied by `wp_localize_script()`.\n *\n * @param dateSettings Settings, including locale data.\n */\nexport function setSettings( dateSettings: DateSettings ) {\n\tsettings = dateSettings;\n\n\tsetupWPTimezone();\n\n\t// Does moment already have a locale with the right name?\n\tif ( momentLib.locales().includes( dateSettings.l10n.locale ) ) {\n\t\t// Is that locale misconfigured, e.g. because we are on a site running\n\t\t// WordPress < 6.0?\n\t\tif (\n\t\t\tmomentLib\n\t\t\t\t.localeData( dateSettings.l10n.locale )\n\t\t\t\t.longDateFormat( 'LTS' ) === null\n\t\t) {\n\t\t\t// Delete the misconfigured locale.\n\t\t\t// @ts-ignore Type definitions are incorrect - null is permitted.\n\t\t\tmomentLib.defineLocale( dateSettings.l10n.locale, null );\n\t\t} else {\n\t\t\t// We have a properly configured locale, so no need to create one.\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// defineLocale() will modify the current locale, so back it up.\n\tconst currentLocale = momentLib.locale();\n\n\t// Create locale.\n\tmomentLib.defineLocale( dateSettings.l10n.locale, {\n\t\t// Inherit anything missing from English. We don't load\n\t\t// moment-with-locales.js so English is all there is.\n\t\tparentLocale: 'en',\n\t\tmonths: dateSettings.l10n.months,\n\t\tmonthsShort: dateSettings.l10n.monthsShort,\n\t\tweekdays: dateSettings.l10n.weekdays,\n\t\tweekdaysShort: dateSettings.l10n.weekdaysShort,\n\t\tmeridiem( hour, minute, isLowercase ) {\n\t\t\tif ( hour < 12 ) {\n\t\t\t\treturn isLowercase\n\t\t\t\t\t? dateSettings.l10n.meridiem.am\n\t\t\t\t\t: dateSettings.l10n.meridiem.AM;\n\t\t\t}\n\t\t\treturn isLowercase\n\t\t\t\t? dateSettings.l10n.meridiem.pm\n\t\t\t\t: dateSettings.l10n.meridiem.PM;\n\t\t},\n\t\tlongDateFormat: {\n\t\t\tLT: dateSettings.formats.time,\n\t\t\tLTS: momentLib.localeData( 'en' ).longDateFormat( 'LTS' ),\n\t\t\tL: momentLib.localeData( 'en' ).longDateFormat( 'L' ),\n\t\t\tLL: dateSettings.formats.date,\n\t\t\tLLL: dateSettings.formats.datetime,\n\t\t\tLLLL: momentLib.localeData( 'en' ).longDateFormat( 'LLLL' ),\n\t\t},\n\t\t// From human_time_diff?\n\t\t// Set to `(number, withoutSuffix, key, isFuture) => {}` instead.\n\t\trelativeTime: dateSettings.l10n.relative,\n\t} );\n\n\t// Restore the locale to what it was.\n\tmomentLib.locale( currentLocale );\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @return {DateSettings} Settings, including locale data.\n */\nexport function getSettings() {\n\treturn settings;\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @deprecated\n * @return {DateSettings} Settings, including locale data.\n */\nexport function __experimentalGetSettings() {\n\tdeprecated( 'wp.date.__experimentalGetSettings', {\n\t\tsince: '6.1',\n\t\talternative: 'wp.date.getSettings',\n\t} );\n\treturn getSettings();\n}\n\nfunction setupWPTimezone() {\n\t// Get the current timezone settings from the WP timezone string.\n\tconst currentTimezone = momentLib.tz.zone( settings.timezone.string );\n\n\t// 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.\n\tif ( currentTimezone ) {\n\t\t// Create WP timezone based off settings.timezone.string. We need to include the additional data so that we\n\t\t// don't lose information about daylight savings time and other items.\n\t\t// See https://github.com/WordPress/gutenberg/pull/48083\n\t\tmomentLib.tz.add(\n\t\t\tmomentLib.tz.pack( {\n\t\t\t\tname: WP_ZONE,\n\t\t\t\tabbrs: currentTimezone.abbrs,\n\t\t\t\tuntils: currentTimezone.untils,\n\t\t\t\toffsets: currentTimezone.offsets,\n\t\t\t} )\n\t\t);\n\t} else {\n\t\t// Create WP timezone based off dateSettings.\n\t\tmomentLib.tz.add(\n\t\t\tmomentLib.tz.pack( {\n\t\t\t\tname: WP_ZONE,\n\t\t\t\tabbrs: [ WP_ZONE ],\n\t\t\t\tuntils: [ null ],\n\t\t\t\toffsets: [ -settings.timezone.offset * 60 || 0 ],\n\t\t\t} )\n\t\t);\n\t}\n}\n\n// Date constants.\n/**\n * Number of seconds in one minute.\n */\nconst MINUTE_IN_SECONDS = 60;\n/**\n * Number of minutes in one hour.\n */\nconst HOUR_IN_MINUTES = 60;\n/**\n * Number of seconds in one hour.\n */\nconst HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;\n\n/**\n * Map of PHP formats to Moment.js formats.\n *\n * These are used internally by {@link format}, and are either\n * a string representing the corresponding Moment.js format code, or a\n * function which returns the formatted string.\n *\n * This should only be used through {@link format}, not\n * directly.\n */\nconst formatMap = {\n\t// Day.\n\td: 'DD',\n\tD: 'ddd',\n\tj: 'D',\n\tl: 'dddd',\n\tN: 'E',\n\n\t/**\n\t * Gets the ordinal suffix.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tS( momentDate: Moment ) {\n\t\t// Do - D.\n\t\tconst num = momentDate.format( 'D' );\n\t\tconst withOrdinal = momentDate.format( 'Do' );\n\t\treturn withOrdinal.replace( num, '' );\n\t},\n\n\tw: 'd',\n\t/**\n\t * Gets the day of the year (zero-indexed).\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tz( momentDate: Moment ) {\n\t\t// DDD - 1.\n\t\treturn ( parseInt( momentDate.format( 'DDD' ), 10 ) - 1 ).toString();\n\t},\n\n\t// Week.\n\tW: 'W',\n\n\t// Month.\n\tF: 'MMMM',\n\tm: 'MM',\n\tM: 'MMM',\n\tn: 'M',\n\t/**\n\t * Gets the days in the month.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tt( momentDate: Moment ) {\n\t\treturn momentDate.daysInMonth();\n\t},\n\n\t// Year.\n\t/**\n\t * Gets whether the current year is a leap year.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tL( momentDate: Moment ) {\n\t\treturn momentDate.isLeapYear() ? '1' : '0';\n\t},\n\to: 'GGGG',\n\tY: 'YYYY',\n\ty: 'YY',\n\n\t// Time.\n\ta: 'a',\n\tA: 'A',\n\t/**\n\t * Gets the current time in Swatch Internet Time (.beats).\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tB( momentDate: Moment ) {\n\t\tconst timezoned = momentLib( momentDate ).utcOffset( 60 );\n\t\tconst seconds = parseInt( timezoned.format( 's' ), 10 ),\n\t\t\tminutes = parseInt( timezoned.format( 'm' ), 10 ),\n\t\t\thours = parseInt( timezoned.format( 'H' ), 10 );\n\t\treturn parseInt(\n\t\t\t(\n\t\t\t\t( seconds +\n\t\t\t\t\tminutes * MINUTE_IN_SECONDS +\n\t\t\t\t\thours * HOUR_IN_SECONDS ) /\n\t\t\t\t86.4\n\t\t\t).toString(),\n\t\t\t10\n\t\t);\n\t},\n\tg: 'h',\n\tG: 'H',\n\th: 'hh',\n\tH: 'HH',\n\ti: 'mm',\n\ts: 'ss',\n\tu: 'SSSSSS',\n\tv: 'SSS',\n\t// Timezone.\n\te: 'zz',\n\t/**\n\t * Gets whether the timezone is in DST currently.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tI( momentDate: Moment ) {\n\t\treturn momentDate.isDST() ? '1' : '0';\n\t},\n\tO: 'ZZ',\n\tP: 'Z',\n\tT: 'z',\n\t/**\n\t * Gets the timezone offset in seconds.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tZ( momentDate: Moment ) {\n\t\t// Timezone offset in seconds.\n\t\tconst offset = momentDate.format( 'Z' );\n\t\tconst sign = offset[ 0 ] === '-' ? -1 : 1;\n\t\tconst parts = offset\n\t\t\t.substring( 1 )\n\t\t\t.split( ':' )\n\t\t\t.map( ( n ) => parseInt( n, 10 ) );\n\t\treturn (\n\t\t\tsign *\n\t\t\t( parts[ 0 ] * HOUR_IN_MINUTES + parts[ 1 ] ) *\n\t\t\tMINUTE_IN_SECONDS\n\t\t);\n\t},\n\t// Full date/time.\n\tc: 'YYYY-MM-DDTHH:mm:ssZ', // .toISOString.\n\t/**\n\t * Formats the date as RFC2822.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tr( momentDate: Moment ) {\n\t\treturn momentDate\n\t\t\t.locale( 'en' )\n\t\t\t.format( 'ddd, DD MMM YYYY HH:mm:ss ZZ' );\n\t},\n\tU: 'X',\n};\n\n/**\n * Formats a date. Does not alter the date's timezone.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return Formatted date.\n */\nexport function format(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date()\n) {\n\tlet i, char;\n\tconst newFormat = [];\n\tconst momentDate = momentLib( dateValue );\n\tfor ( i = 0; i < dateFormat.length; i++ ) {\n\t\tchar = dateFormat[ i ];\n\t\t// Is this an escape?\n\t\tif ( '\\\\' === char ) {\n\t\t\t// Add next character, then move on.\n\t\t\ti++;\n\t\t\tnewFormat.push( '[' + dateFormat[ i ] + ']' );\n\t\t\tcontinue;\n\t\t}\n\t\tif ( char in formatMap ) {\n\t\t\tconst formatter = formatMap[ char as keyof typeof formatMap ];\n\t\t\tif ( typeof formatter !== 'string' ) {\n\t\t\t\t// If the format is a function, call it.\n\t\t\t\tnewFormat.push( '[' + formatter( momentDate ) + ']' );\n\t\t\t} else {\n\t\t\t\t// Otherwise, add as a formatting string.\n\t\t\t\tnewFormat.push( formatter );\n\t\t\t}\n\t\t} else {\n\t\t\tnewFormat.push( '[' + char + ']' );\n\t\t}\n\t}\n\t// Join with [] between to separate characters, and replace\n\t// unneeded separators with static text.\n\treturn momentDate.format( newFormat.join( '[]' ) );\n}\n\n/**\n * Formats a date (like `date()` in PHP).\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string, parsable\n * by moment.js.\n * @param timezone Timezone to output result in or a\n * UTC offset. Defaults to timezone from\n * site.\n *\n * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\n *\n * @return {string} Formatted date in English.\n */\nexport function date(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date(),\n\ttimezone?: string\n) {\n\tconst dateMoment = buildMoment( dateValue, timezone );\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Formats a date (like `date()` in PHP), in the UTC timezone.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return Formatted date in English.\n */\nexport function gmdate(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date()\n) {\n\tconst dateMoment = momentLib( dateValue ).utc();\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Formats a date (like `wp_date()` in PHP), translating it into site's locale.\n *\n * Backward Compatibility Notice: if `timezone` is set to `true`, the function\n * behaves like `gmdateI18n`.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string, parsable by\n * moment.js.\n * @param timezone Timezone to output result in or a\n * UTC offset. Defaults to timezone from\n * site. Notice: `boolean` is effectively\n * deprecated, but still supported for\n * backward compatibility reasons.\n *\n * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\n *\n * @return Formatted date.\n */\nexport function dateI18n(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date(),\n\ttimezone?: string | number | boolean\n) {\n\tif ( true === timezone ) {\n\t\treturn gmdateI18n( dateFormat, dateValue );\n\t}\n\n\tif ( false === timezone ) {\n\t\ttimezone = undefined;\n\t}\n\n\tconst dateMoment = buildMoment( dateValue, timezone );\n\tdateMoment.locale( settings.l10n.locale );\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Formats a date (like `wp_date()` in PHP), translating it into site's locale\n * and using the UTC timezone.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return Formatted date.\n */\nexport function gmdateI18n(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date()\n) {\n\tconst dateMoment = momentLib( dateValue ).utc();\n\tdateMoment.locale( settings.l10n.locale );\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Check whether a date is considered in the future according to the WordPress settings.\n *\n * @param dateValue Date String or Date object in the Defined WP Timezone.\n *\n * @return Is in the future.\n */\nexport function isInTheFuture( dateValue: Date | string | number ) {\n\tconst now = momentLib.tz( WP_ZONE );\n\tconst momentObject = momentLib.tz( dateValue, WP_ZONE );\n\n\treturn momentObject.isAfter( now );\n}\n\n/**\n * Create and return a JavaScript Date Object from a date string in the WP timezone.\n *\n * @param dateString Date formatted in the WP timezone.\n *\n * @return Date\n */\nexport function getDate( dateString?: string | null ) {\n\tif ( ! dateString ) {\n\t\treturn momentLib.tz( WP_ZONE ).toDate();\n\t}\n\n\treturn momentLib.tz( dateString, WP_ZONE ).toDate();\n}\n\n/**\n * Returns a human-readable time difference between two dates, like human_time_diff() in PHP.\n *\n * @param from From date, in the WP timezone.\n * @param to To date, formatted in the WP timezone.\n *\n * @return Human-readable time difference.\n */\nexport function humanTimeDiff(\n\tfrom: Moment | Date | string | number,\n\tto?: Moment | Date | string | number\n) {\n\tconst fromMoment = momentLib.tz( from, WP_ZONE );\n\tconst toMoment = to ? momentLib.tz( to, WP_ZONE ) : momentLib.tz( WP_ZONE );\n\treturn fromMoment.from( toMoment );\n}\n\n/**\n * Creates a moment instance using the given timezone or, if none is provided, using global settings.\n *\n * @param dateValue Date object or string, parsable\n * by moment.js.\n * @param timezone Timezone to output result in or a\n * UTC offset. Defaults to timezone from\n * site.\n *\n * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\n *\n * @return A moment instance.\n */\nfunction buildMoment(\n\tdateValue?: Moment | Date | string | number,\n\ttimezone: string | number = ''\n) {\n\tconst dateMoment = momentLib( dateValue );\n\n\tif ( timezone && ! isUTCOffset( timezone ) ) {\n\t\t// The ! isUTCOffset() check guarantees that timezone is a string.\n\t\treturn dateMoment.tz( timezone as string );\n\t}\n\n\tif ( timezone && isUTCOffset( timezone ) ) {\n\t\treturn dateMoment.utcOffset( timezone );\n\t}\n\n\tif ( settings.timezone.string ) {\n\t\treturn dateMoment.tz( settings.timezone.string );\n\t}\n\n\treturn dateMoment.utcOffset( +settings.timezone.offset );\n}\n\n/**\n * Returns whether a certain UTC offset is valid or not.\n *\n * @param offset a UTC offset.\n *\n * @return whether a certain UTC offset is valid or not.\n */\nfunction isUTCOffset( offset: number | string ) {\n\tif ( 'number' === typeof offset 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gBA,SAAS,YACR,WACA,WAA4B,IAC3B;AACD,QAAM,iBAAa,cAAAA,SAAW,SAAU;AAExC,MAAK,YAAY,CAAE,YAAa,QAAS,GAAI;AAE5C,WAAO,WAAW,GAAI,QAAmB;AAAA,EAC1C;AAEA,MAAK,YAAY,YAAa,QAAS,GAAI;AAC1C,WAAO,WAAW,UAAW,QAAS;AAAA,EACvC;AAEA,MAAK,SAAS,SAAS,QAAS;AAC/B,WAAO,WAAW,GAAI,SAAS,SAAS,MAAO;AAAA,EAChD;AAEA,SAAO,WAAW,UAAW,CAAC,SAAS,SAAS,MAAO;AACxD;AASA,SAAS,YAAa,QAA0B;AAC/C,MAAK,aAAa,OAAO,QAAS;AACjC,WAAO;AAAA,EACR;AAEA,SAAO,iBAAiB,KAAM,MAAO;AACtC;AAEA,gBAAgB;",
|
|
6
6
|
"names": ["momentLib", "deprecated"]
|
|
7
7
|
}
|
package/build/types.js
CHANGED
|
@@ -12,6 +12,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
12
12
|
return to;
|
|
13
13
|
};
|
|
14
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// packages/date/src/types.ts
|
|
15
17
|
var types_exports = {};
|
|
16
18
|
module.exports = __toCommonJS(types_exports);
|
|
17
19
|
//# sourceMappingURL=types.js.map
|
package/build/types.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/types.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { LocaleSpecification as MomentLocaleSpecification } from 'moment';\n\nexport type MeridiemConfig = {\n\t/**\n\t * Lowercase AM.\n\t */\n\tam: string;\n\n\t/**\n\t * Uppercase AM.\n\t */\n\tAM: string;\n\n\t/**\n\t * Lowercase PM.\n\t */\n\tpm: string;\n\n\t/**\n\t * Uppercase PM.\n\t */\n\tPM: string;\n};\n\nexport type FormatsConfig = {\n\t/**\n\t * Time format.\n\t */\n\ttime: string;\n\n\t/**\n\t * Date format.\n\t */\n\tdate: string;\n\n\t/**\n\t * Datetime format.\n\t */\n\tdatetime: string;\n\n\t/**\n\t * Abbreviated datetime format.\n\t */\n\tdatetimeAbbreviated: string;\n};\n\nexport type TimezoneConfig = {\n\t/**\n\t * Offset setting.\n\t */\n\toffset: string;\n\n\t/**\n\t * Offset setting with decimals formatted to minutes.\n\t */\n\toffsetFormatted: string;\n\n\t/**\n\t * The timezone as a string (e.g., `'America/Los_Angeles'`).\n\t */\n\tstring: string;\n\n\t/**\n\t * Abbreviation for the timezone.\n\t */\n\tabbr: string;\n};\n\nexport type L10nSettings = {\n\t/**\n\t * Moment locale.\n\t */\n\tlocale: string;\n\n\t/**\n\t * Locale months.\n\t *\n\t * @example\n\t * ['January', 'February', ... ]\n\t */\n\tmonths: MomentLocaleSpecification[ 'months' ];\n\n\t/**\n\t * Locale months short.\n\t *\n\t * @example\n\t * ['Jan', 'Feb', ... ]\n\t */\n\tmonthsShort: MomentLocaleSpecification[ 'monthsShort' ];\n\n\t/**\n\t * Locale weekdays.\n\t *\n\t * @example\n\t * ['Sunday', 'Monday', ... ]\n\t */\n\tweekdays: MomentLocaleSpecification[ 'weekdays' ];\n\n\t/**\n\t * Locale weekdays short.\n\t */\n\tweekdaysShort: MomentLocaleSpecification[ 'weekdaysShort' ];\n\n\t/**\n\t * Meridiem config.\n\t */\n\tmeridiem: MeridiemConfig;\n\n\t/**\n\t * Relative time config.\n\t */\n\trelative: MomentLocaleSpecification[ 'relativeTime' ];\n\n\t/**\n\t * Day that the week starts on.\n\t */\n\tstartOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n};\n\nexport type DateSettings = {\n\t/**\n\t * Localization settings.\n\t */\n\tl10n: L10nSettings;\n\n\t/**\n\t * Date/time formats config.\n\t */\n\tformats: FormatsConfig;\n\n\t/**\n\t * Timezone settings.\n\t */\n\ttimezone: TimezoneConfig;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-module/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
// packages/date/src/index.ts
|
|
1
2
|
import momentLib from "moment";
|
|
2
3
|
import "moment-timezone/moment-timezone";
|
|
3
4
|
import "moment-timezone/moment-timezone-utils";
|
|
4
5
|
import deprecated from "@wordpress/deprecated";
|
|
5
6
|
export * from "./types";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var WP_ZONE = "WP";
|
|
8
|
+
var VALID_UTC_OFFSET = /^[+-][0-1][0-9](:?[0-9][0-9])?$/;
|
|
9
|
+
var settings = {
|
|
9
10
|
l10n: {
|
|
10
11
|
locale: "en",
|
|
11
12
|
months: [
|
|
@@ -144,10 +145,10 @@ function setupWPTimezone() {
|
|
|
144
145
|
);
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
var MINUTE_IN_SECONDS = 60;
|
|
149
|
+
var HOUR_IN_MINUTES = 60;
|
|
150
|
+
var HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
|
|
151
|
+
var formatMap = {
|
|
151
152
|
// Day.
|
|
152
153
|
d: "DD",
|
|
153
154
|
D: "ddd",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Moment } from 'moment';\nimport momentLib from 'moment';\nimport 'moment-timezone/moment-timezone';\nimport 'moment-timezone/moment-timezone-utils';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { DateSettings } from './types';\n\nexport * from './types';\n\nconst WP_ZONE = 'WP';\n\n// This regular expression tests positive for UTC offsets as described in ISO 8601.\n// See: https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\nconst VALID_UTC_OFFSET = /^[+-][0-1][0-9](:?[0-9][0-9])?$/;\n\n// Changes made here will likely need to be synced with Core in the file\n// src/wp-includes/script-loader.php in `wp_default_packages_inline_scripts()`.\nlet settings: DateSettings = {\n\tl10n: {\n\t\tlocale: 'en',\n\t\tmonths: [\n\t\t\t'January',\n\t\t\t'February',\n\t\t\t'March',\n\t\t\t'April',\n\t\t\t'May',\n\t\t\t'June',\n\t\t\t'July',\n\t\t\t'August',\n\t\t\t'September',\n\t\t\t'October',\n\t\t\t'November',\n\t\t\t'December',\n\t\t],\n\t\tmonthsShort: [\n\t\t\t'Jan',\n\t\t\t'Feb',\n\t\t\t'Mar',\n\t\t\t'Apr',\n\t\t\t'May',\n\t\t\t'Jun',\n\t\t\t'Jul',\n\t\t\t'Aug',\n\t\t\t'Sep',\n\t\t\t'Oct',\n\t\t\t'Nov',\n\t\t\t'Dec',\n\t\t],\n\t\tweekdays: [\n\t\t\t'Sunday',\n\t\t\t'Monday',\n\t\t\t'Tuesday',\n\t\t\t'Wednesday',\n\t\t\t'Thursday',\n\t\t\t'Friday',\n\t\t\t'Saturday',\n\t\t],\n\t\tweekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],\n\t\tmeridiem: { am: 'am', pm: 'pm', AM: 'AM', PM: 'PM' },\n\t\trelative: {\n\t\t\tfuture: '%s from now',\n\t\t\tpast: '%s ago',\n\t\t\ts: 'a few seconds',\n\t\t\tss: '%d seconds',\n\t\t\tm: 'a minute',\n\t\t\tmm: '%d minutes',\n\t\t\th: 'an hour',\n\t\t\thh: '%d hours',\n\t\t\td: 'a day',\n\t\t\tdd: '%d days',\n\t\t\tM: 'a month',\n\t\t\tMM: '%d months',\n\t\t\ty: 'a year',\n\t\t\tyy: '%d years',\n\t\t},\n\t\tstartOfWeek: 0,\n\t},\n\tformats: {\n\t\ttime: 'g: i a',\n\t\tdate: 'F j, Y',\n\t\tdatetime: 'F j, Y g: i a',\n\t\tdatetimeAbbreviated: 'M j, Y g: i a',\n\t},\n\ttimezone: { offset: '0', offsetFormatted: '0', string: '', abbr: '' },\n};\n\n/**\n * Adds a locale to moment, using the format supplied by `wp_localize_script()`.\n *\n * @param dateSettings Settings, including locale data.\n */\nexport function setSettings( dateSettings: DateSettings ) {\n\tsettings = dateSettings;\n\n\tsetupWPTimezone();\n\n\t// Does moment already have a locale with the right name?\n\tif ( momentLib.locales().includes( dateSettings.l10n.locale ) ) {\n\t\t// Is that locale misconfigured, e.g. because we are on a site running\n\t\t// WordPress < 6.0?\n\t\tif (\n\t\t\tmomentLib\n\t\t\t\t.localeData( dateSettings.l10n.locale )\n\t\t\t\t.longDateFormat( 'LTS' ) === null\n\t\t) {\n\t\t\t// Delete the misconfigured locale.\n\t\t\t// @ts-ignore Type definitions are incorrect - null is permitted.\n\t\t\tmomentLib.defineLocale( dateSettings.l10n.locale, null );\n\t\t} else {\n\t\t\t// We have a properly configured locale, so no need to create one.\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// defineLocale() will modify the current locale, so back it up.\n\tconst currentLocale = momentLib.locale();\n\n\t// Create locale.\n\tmomentLib.defineLocale( dateSettings.l10n.locale, {\n\t\t// Inherit anything missing from English. We don't load\n\t\t// moment-with-locales.js so English is all there is.\n\t\tparentLocale: 'en',\n\t\tmonths: dateSettings.l10n.months,\n\t\tmonthsShort: dateSettings.l10n.monthsShort,\n\t\tweekdays: dateSettings.l10n.weekdays,\n\t\tweekdaysShort: dateSettings.l10n.weekdaysShort,\n\t\tmeridiem( hour, minute, isLowercase ) {\n\t\t\tif ( hour < 12 ) {\n\t\t\t\treturn isLowercase\n\t\t\t\t\t? dateSettings.l10n.meridiem.am\n\t\t\t\t\t: dateSettings.l10n.meridiem.AM;\n\t\t\t}\n\t\t\treturn isLowercase\n\t\t\t\t? dateSettings.l10n.meridiem.pm\n\t\t\t\t: dateSettings.l10n.meridiem.PM;\n\t\t},\n\t\tlongDateFormat: {\n\t\t\tLT: dateSettings.formats.time,\n\t\t\tLTS: momentLib.localeData( 'en' ).longDateFormat( 'LTS' ),\n\t\t\tL: momentLib.localeData( 'en' ).longDateFormat( 'L' ),\n\t\t\tLL: dateSettings.formats.date,\n\t\t\tLLL: dateSettings.formats.datetime,\n\t\t\tLLLL: momentLib.localeData( 'en' ).longDateFormat( 'LLLL' ),\n\t\t},\n\t\t// From human_time_diff?\n\t\t// Set to `(number, withoutSuffix, key, isFuture) => {}` instead.\n\t\trelativeTime: dateSettings.l10n.relative,\n\t} );\n\n\t// Restore the locale to what it was.\n\tmomentLib.locale( currentLocale );\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @return {DateSettings} Settings, including locale data.\n */\nexport function getSettings() {\n\treturn settings;\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @deprecated\n * @return {DateSettings} Settings, including locale data.\n */\nexport function __experimentalGetSettings() {\n\tdeprecated( 'wp.date.__experimentalGetSettings', {\n\t\tsince: '6.1',\n\t\talternative: 'wp.date.getSettings',\n\t} );\n\treturn getSettings();\n}\n\nfunction setupWPTimezone() {\n\t// Get the current timezone settings from the WP timezone string.\n\tconst currentTimezone = momentLib.tz.zone( settings.timezone.string );\n\n\t// 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.\n\tif ( currentTimezone ) {\n\t\t// Create WP timezone based off settings.timezone.string. We need to include the additional data so that we\n\t\t// don't lose information about daylight savings time and other items.\n\t\t// See https://github.com/WordPress/gutenberg/pull/48083\n\t\tmomentLib.tz.add(\n\t\t\tmomentLib.tz.pack( {\n\t\t\t\tname: WP_ZONE,\n\t\t\t\tabbrs: currentTimezone.abbrs,\n\t\t\t\tuntils: currentTimezone.untils,\n\t\t\t\toffsets: currentTimezone.offsets,\n\t\t\t} )\n\t\t);\n\t} else {\n\t\t// Create WP timezone based off dateSettings.\n\t\tmomentLib.tz.add(\n\t\t\tmomentLib.tz.pack( {\n\t\t\t\tname: WP_ZONE,\n\t\t\t\tabbrs: [ WP_ZONE ],\n\t\t\t\tuntils: [ null ],\n\t\t\t\toffsets: [ -settings.timezone.offset * 60 || 0 ],\n\t\t\t} )\n\t\t);\n\t}\n}\n\n// Date constants.\n/**\n * Number of seconds in one minute.\n */\nconst MINUTE_IN_SECONDS = 60;\n/**\n * Number of minutes in one hour.\n */\nconst HOUR_IN_MINUTES = 60;\n/**\n * Number of seconds in one hour.\n */\nconst HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;\n\n/**\n * Map of PHP formats to Moment.js formats.\n *\n * These are used internally by {@link format}, and are either\n * a string representing the corresponding Moment.js format code, or a\n * function which returns the formatted string.\n *\n * This should only be used through {@link format}, not\n * directly.\n */\nconst formatMap = {\n\t// Day.\n\td: 'DD',\n\tD: 'ddd',\n\tj: 'D',\n\tl: 'dddd',\n\tN: 'E',\n\n\t/**\n\t * Gets the ordinal suffix.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tS( momentDate: Moment ) {\n\t\t// Do - D.\n\t\tconst num = momentDate.format( 'D' );\n\t\tconst withOrdinal = momentDate.format( 'Do' );\n\t\treturn withOrdinal.replace( num, '' );\n\t},\n\n\tw: 'd',\n\t/**\n\t * Gets the day of the year (zero-indexed).\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tz( momentDate: Moment ) {\n\t\t// DDD - 1.\n\t\treturn ( parseInt( momentDate.format( 'DDD' ), 10 ) - 1 ).toString();\n\t},\n\n\t// Week.\n\tW: 'W',\n\n\t// Month.\n\tF: 'MMMM',\n\tm: 'MM',\n\tM: 'MMM',\n\tn: 'M',\n\t/**\n\t * Gets the days in the month.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tt( momentDate: Moment ) {\n\t\treturn momentDate.daysInMonth();\n\t},\n\n\t// Year.\n\t/**\n\t * Gets whether the current year is a leap year.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tL( momentDate: Moment ) {\n\t\treturn momentDate.isLeapYear() ? '1' : '0';\n\t},\n\to: 'GGGG',\n\tY: 'YYYY',\n\ty: 'YY',\n\n\t// Time.\n\ta: 'a',\n\tA: 'A',\n\t/**\n\t * Gets the current time in Swatch Internet Time (.beats).\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tB( momentDate: Moment ) {\n\t\tconst timezoned = momentLib( momentDate ).utcOffset( 60 );\n\t\tconst seconds = parseInt( timezoned.format( 's' ), 10 ),\n\t\t\tminutes = parseInt( timezoned.format( 'm' ), 10 ),\n\t\t\thours = parseInt( timezoned.format( 'H' ), 10 );\n\t\treturn parseInt(\n\t\t\t(\n\t\t\t\t( seconds +\n\t\t\t\t\tminutes * MINUTE_IN_SECONDS +\n\t\t\t\t\thours * HOUR_IN_SECONDS ) /\n\t\t\t\t86.4\n\t\t\t).toString(),\n\t\t\t10\n\t\t);\n\t},\n\tg: 'h',\n\tG: 'H',\n\th: 'hh',\n\tH: 'HH',\n\ti: 'mm',\n\ts: 'ss',\n\tu: 'SSSSSS',\n\tv: 'SSS',\n\t// Timezone.\n\te: 'zz',\n\t/**\n\t * Gets whether the timezone is in DST currently.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tI( momentDate: Moment ) {\n\t\treturn momentDate.isDST() ? '1' : '0';\n\t},\n\tO: 'ZZ',\n\tP: 'Z',\n\tT: 'z',\n\t/**\n\t * Gets the timezone offset in seconds.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tZ( momentDate: Moment ) {\n\t\t// Timezone offset in seconds.\n\t\tconst offset = momentDate.format( 'Z' );\n\t\tconst sign = offset[ 0 ] === '-' ? -1 : 1;\n\t\tconst parts = offset\n\t\t\t.substring( 1 )\n\t\t\t.split( ':' )\n\t\t\t.map( ( n ) => parseInt( n, 10 ) );\n\t\treturn (\n\t\t\tsign *\n\t\t\t( parts[ 0 ] * HOUR_IN_MINUTES + parts[ 1 ] ) *\n\t\t\tMINUTE_IN_SECONDS\n\t\t);\n\t},\n\t// Full date/time.\n\tc: 'YYYY-MM-DDTHH:mm:ssZ', // .toISOString.\n\t/**\n\t * Formats the date as RFC2822.\n\t *\n\t * @param momentDate Moment instance.\n\t *\n\t * @return Formatted date.\n\t */\n\tr( momentDate: Moment ) {\n\t\treturn momentDate\n\t\t\t.locale( 'en' )\n\t\t\t.format( 'ddd, DD MMM YYYY HH:mm:ss ZZ' );\n\t},\n\tU: 'X',\n};\n\n/**\n * Formats a date. Does not alter the date's timezone.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return Formatted date.\n */\nexport function format(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date()\n) {\n\tlet i, char;\n\tconst newFormat = [];\n\tconst momentDate = momentLib( dateValue );\n\tfor ( i = 0; i < dateFormat.length; i++ ) {\n\t\tchar = dateFormat[ i ];\n\t\t// Is this an escape?\n\t\tif ( '\\\\' === char ) {\n\t\t\t// Add next character, then move on.\n\t\t\ti++;\n\t\t\tnewFormat.push( '[' + dateFormat[ i ] + ']' );\n\t\t\tcontinue;\n\t\t}\n\t\tif ( char in formatMap ) {\n\t\t\tconst formatter = formatMap[ char as keyof typeof formatMap ];\n\t\t\tif ( typeof formatter !== 'string' ) {\n\t\t\t\t// If the format is a function, call it.\n\t\t\t\tnewFormat.push( '[' + formatter( momentDate ) + ']' );\n\t\t\t} else {\n\t\t\t\t// Otherwise, add as a formatting string.\n\t\t\t\tnewFormat.push( formatter );\n\t\t\t}\n\t\t} else {\n\t\t\tnewFormat.push( '[' + char + ']' );\n\t\t}\n\t}\n\t// Join with [] between to separate characters, and replace\n\t// unneeded separators with static text.\n\treturn momentDate.format( newFormat.join( '[]' ) );\n}\n\n/**\n * Formats a date (like `date()` in PHP).\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string, parsable\n * by moment.js.\n * @param timezone Timezone to output result in or a\n * UTC offset. Defaults to timezone from\n * site.\n *\n * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\n *\n * @return {string} Formatted date in English.\n */\nexport function date(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date(),\n\ttimezone?: string\n) {\n\tconst dateMoment = buildMoment( dateValue, timezone );\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Formats a date (like `date()` in PHP), in the UTC timezone.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return Formatted date in English.\n */\nexport function gmdate(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date()\n) {\n\tconst dateMoment = momentLib( dateValue ).utc();\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Formats a date (like `wp_date()` in PHP), translating it into site's locale.\n *\n * Backward Compatibility Notice: if `timezone` is set to `true`, the function\n * behaves like `gmdateI18n`.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string, parsable by\n * moment.js.\n * @param timezone Timezone to output result in or a\n * UTC offset. Defaults to timezone from\n * site. Notice: `boolean` is effectively\n * deprecated, but still supported for\n * backward compatibility reasons.\n *\n * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\n *\n * @return Formatted date.\n */\nexport function dateI18n(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date(),\n\ttimezone?: string | number | boolean\n) {\n\tif ( true === timezone ) {\n\t\treturn gmdateI18n( dateFormat, dateValue );\n\t}\n\n\tif ( false === timezone ) {\n\t\ttimezone = undefined;\n\t}\n\n\tconst dateMoment = buildMoment( dateValue, timezone );\n\tdateMoment.locale( settings.l10n.locale );\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Formats a date (like `wp_date()` in PHP), translating it into site's locale\n * and using the UTC timezone.\n *\n * @param dateFormat PHP-style formatting string.\n * See [php.net/date](https://www.php.net/manual/en/function.date.php).\n * @param dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return Formatted date.\n */\nexport function gmdateI18n(\n\tdateFormat: string,\n\tdateValue: Moment | Date | string | number = new Date()\n) {\n\tconst dateMoment = momentLib( dateValue ).utc();\n\tdateMoment.locale( settings.l10n.locale );\n\treturn format( dateFormat, dateMoment );\n}\n\n/**\n * Check whether a date is considered in the future according to the WordPress settings.\n *\n * @param dateValue Date String or Date object in the Defined WP Timezone.\n *\n * @return Is in the future.\n */\nexport function isInTheFuture( dateValue: Date | string | number ) {\n\tconst now = momentLib.tz( WP_ZONE );\n\tconst momentObject = momentLib.tz( dateValue, WP_ZONE );\n\n\treturn momentObject.isAfter( now );\n}\n\n/**\n * Create and return a JavaScript Date Object from a date string in the WP timezone.\n *\n * @param dateString Date formatted in the WP timezone.\n *\n * @return Date\n */\nexport function getDate( dateString?: string | null ) {\n\tif ( ! dateString ) {\n\t\treturn momentLib.tz( WP_ZONE ).toDate();\n\t}\n\n\treturn momentLib.tz( dateString, WP_ZONE ).toDate();\n}\n\n/**\n * Returns a human-readable time difference between two dates, like human_time_diff() in PHP.\n *\n * @param from From date, in the WP timezone.\n * @param to To date, formatted in the WP timezone.\n *\n * @return Human-readable time difference.\n */\nexport function humanTimeDiff(\n\tfrom: Moment | Date | string | number,\n\tto?: Moment | Date | string | number\n) {\n\tconst fromMoment = momentLib.tz( from, WP_ZONE );\n\tconst toMoment = to ? momentLib.tz( to, WP_ZONE ) : momentLib.tz( WP_ZONE );\n\treturn fromMoment.from( toMoment );\n}\n\n/**\n * Creates a moment instance using the given timezone or, if none is provided, using global settings.\n *\n * @param dateValue Date object or string, parsable\n * by moment.js.\n * @param timezone Timezone to output result in or a\n * UTC offset. Defaults to timezone from\n * site.\n *\n * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC\n *\n * @return A moment instance.\n */\nfunction buildMoment(\n\tdateValue?: Moment | Date | string | number,\n\ttimezone: string | number = ''\n) {\n\tconst dateMoment = momentLib( dateValue );\n\n\tif ( timezone && ! isUTCOffset( timezone ) ) {\n\t\t// The ! isUTCOffset() check guarantees that timezone is a string.\n\t\treturn dateMoment.tz( timezone as string );\n\t}\n\n\tif ( timezone && isUTCOffset( timezone ) ) {\n\t\treturn dateMoment.utcOffset( timezone );\n\t}\n\n\tif ( settings.timezone.string ) {\n\t\treturn dateMoment.tz( settings.timezone.string );\n\t}\n\n\treturn dateMoment.utcOffset( +settings.timezone.offset );\n}\n\n/**\n * Returns whether a certain UTC offset is valid or not.\n *\n * @param offset a UTC offset.\n *\n * @return whether a certain UTC offset is valid or not.\n */\nfunction isUTCOffset( offset: number | string ) {\n\tif ( 'number' === typeof offset ) {\n\t\treturn true;\n\t}\n\n\treturn VALID_UTC_OFFSET.test( offset );\n}\n\nsetupWPTimezone();\n"],
|
|
5
|
-
"mappings": "AAIA,OAAO,eAAe;AACtB,OAAO;AACP,OAAO;AAKP,OAAO,gBAAgB;AAMvB,cAAc;AAEd,
|
|
5
|
+
"mappings": ";AAIA,OAAO,eAAe;AACtB,OAAO;AACP,OAAO;AAKP,OAAO,gBAAgB;AAMvB,cAAc;AAEd,IAAM,UAAU;AAIhB,IAAM,mBAAmB;AAIzB,IAAI,WAAyB;AAAA,EAC5B,MAAM;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAC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,UAAW;AACvC;AASO,SAAS,cAAe,WAAoC;AAClE,QAAM,MAAM,UAAU,GAAI,OAAQ;AAClC,QAAM,eAAe,UAAU,GAAI,WAAW,OAAQ;AAEtD,SAAO,aAAa,QAAS,GAAI;AAClC;AASO,SAAS,QAAS,YAA6B;AACrD,MAAK,CAAE,YAAa;AACnB,WAAO,UAAU,GAAI,OAAQ,EAAE,OAAO;AAAA,EACvC;AAEA,SAAO,UAAU,GAAI,YAAY,OAAQ,EAAE,OAAO;AACnD;AAUO,SAAS,cACf,MACA,IACC;AACD,QAAM,aAAa,UAAU,GAAI,MAAM,OAAQ;AAC/C,QAAM,WAAW,KAAK,UAAU,GAAI,IAAI,OAAQ,IAAI,UAAU,GAAI,OAAQ;AAC1E,SAAO,WAAW,KAAM,QAAS;AAClC;AAgBA,SAAS,YACR,WACA,WAA4B,IAC3B;AACD,QAAM,aAAa,UAAW,SAAU;AAExC,MAAK,YAAY,CAAE,YAAa,QAAS,GAAI;AAE5C,WAAO,WAAW,GAAI,QAAmB;AAAA,EAC1C;AAEA,MAAK,YAAY,YAAa,QAAS,GAAI;AAC1C,WAAO,WAAW,UAAW,QAAS;AAAA,EACvC;AAEA,MAAK,SAAS,SAAS,QAAS;AAC/B,WAAO,WAAW,GAAI,SAAS,SAAS,MAAO;AAAA,EAChD;AAEA,SAAO,WAAW,UAAW,CAAC,SAAS,SAAS,MAAO;AACxD;AASA,SAAS,YAAa,QAA0B;AAC/C,MAAK,aAAa,OAAO,QAAS;AACjC,WAAO;AAAA,EACR;AAEA,SAAO,iBAAiB,KAAM,MAAO;AACtC;AAEA,gBAAgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/date",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.34.1-next.2f1c7c01b.0",
|
|
4
4
|
"description": "Date module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"wpScript": true,
|
|
37
37
|
"types": "build-types",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@wordpress/deprecated": "^4.
|
|
39
|
+
"@wordpress/deprecated": "^4.34.1-next.2f1c7c01b.0",
|
|
40
40
|
"moment": "^2.29.4",
|
|
41
41
|
"moment-timezone": "^0.5.40"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "c6ddcdf455bc02567a2c9e03de6862a2061b85e8"
|
|
47
47
|
}
|