@wordpress/date 4.39.0 → 4.40.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 +38 -99
- package/build/index.js.map +1 -1
- package/build-module/index.js +39 -79
- package/build-module/index.js.map +1 -1
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/date/src/index.js"],"names":["WP_ZONE","VALID_UTC_OFFSET","settings","l10n","locale","months","monthsShort","weekdays","weekdaysShort","meridiem","am","pm","AM","PM","relative","future","past","s","ss","m","mm","h","hh","d","dd","M","MM","y","yy","startOfWeek","formats","time","date","datetime","datetimeAbbreviated","timezone","offset","string","abbr","setSettings","dateSettings","setupWPTimezone","momentLib","locales","includes","localeData","longDateFormat","defineLocale","currentLocale","parentLocale","hour","minute","isLowercase","LT","LTS","L","LL","LLL","LLLL","relativeTime","getSettings","__experimentalGetSettings","since","alternative","tz","add","pack","name","abbrs","untils","offsets","MINUTE_IN_SECONDS","HOUR_IN_MINUTES","HOUR_IN_SECONDS","formatMap","D","j","l","N","S","momentDate","num","format","withOrdinal","replace","w","z","parseInt","toString","W","F","n","t","daysInMonth","isLeapYear","o","Y","a","A","B","timezoned","utcOffset","seconds","minutes","hours","g","G","H","i","u","v","e","I","isDST","O","P","T","Z","sign","parts","substring","split","map","c","r","U","dateFormat","dateValue","Date","char","newFormat","length","push","formatter","join","dateMoment","buildMoment","gmdate","utc","dateI18n","gmdateI18n","undefined","isInTheFuture","now","momentObject","isAfter","getDate","dateString","toDate","humanTimeDiff","from","to","fromMoment","toMoment","isUTCOffset","test"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;A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EAAX,CAAe9D,QAAQ,CAACiC,QAAT,CAAkBE,MAAjC,CAAP;AACA;;AAED,SAAOkG,UAAU,CAAClC,SAAX,CAAsB,CAACnG,QAAQ,CAACiC,QAAT,CAAkBC,MAAzC,CAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASsH,WAAT,CAAsBtH,MAAtB,EAA+B;AAC9B,MAAK,aAAa,OAAOA,MAAzB,EAAkC;AACjC,WAAO,IAAP;AACA;;AAED,SAAOnC,gBAAgB,CAAC0J,IAAjB,CAAuBvH,MAAvB,CAAP;AACA;;AAEDK,eAAe","sourcesContent":["/**\n * External dependencies\n */\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/** @typedef {import('moment').Moment} Moment */\n/** @typedef {import('moment').LocaleSpecification} MomentLocaleSpecification */\n\n/**\n * @typedef MeridiemConfig\n * @property {string} am Lowercase AM.\n * @property {string} AM Uppercase AM.\n * @property {string} pm Lowercase PM.\n * @property {string} PM Uppercase PM.\n */\n\n/**\n * @typedef FormatsConfig\n * @property {string} time Time format.\n * @property {string} date Date format.\n * @property {string} datetime Datetime format.\n * @property {string} datetimeAbbreviated Abbreviated datetime format.\n */\n\n/**\n * @typedef TimezoneConfig\n * @property {string} offset Offset setting.\n * @property {string} string The timezone as a string (e.g., `'America/Los_Angeles'`).\n * @property {string} abbr Abbreviation for the timezone.\n */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * @typedef L10nSettings\n * @property {string} locale Moment locale.\n * @property {MomentLocaleSpecification['months']} months Locale months.\n * @property {MomentLocaleSpecification['monthsShort']} monthsShort Locale months short.\n * @property {MomentLocaleSpecification['weekdays']} weekdays Locale weekdays.\n * @property {MomentLocaleSpecification['weekdaysShort']} weekdaysShort Locale weekdays short.\n * @property {MeridiemConfig} meridiem Meridiem config.\n * @property {MomentLocaleSpecification['relativeTime']} relative Relative time config.\n * @property {0|1|2|3|4|5|6} startOfWeek Day that the week starts on.\n */\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @typedef DateSettings\n * @property {L10nSettings} l10n Localization settings.\n * @property {FormatsConfig} formats Date/time formats config.\n * @property {TimezoneConfig} timezone Timezone settings.\n */\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 made in `lib/client-assets.php` as\n// well because it uses the `setSettings()` function to change these settings.\n/** @type {DateSettings} */\nlet settings = {\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', string: '', abbr: '' },\n};\n\n/**\n * Adds a locale to moment, using the format supplied by `wp_localize_script()`.\n *\n * @param {DateSettings} dateSettings Settings, including locale data.\n */\nexport function setSettings( 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// Create WP timezone based off dateSettings.\n\tmomentLib.tz.add(\n\t\tmomentLib.tz.pack( {\n\t\t\tname: WP_ZONE,\n\t\t\tabbrs: [ WP_ZONE ],\n\t\t\tuntils: [ null ],\n\t\t\toffsets: [ -settings.timezone.offset * 60 || 0 ],\n\t\t} )\n\t);\n}\n\n// Date constants.\n/**\n * Number of seconds in one minute.\n *\n * @type {number}\n */\nconst MINUTE_IN_SECONDS = 60;\n/**\n * Number of minutes in one hour.\n *\n * @type {number}\n */\nconst HOUR_IN_MINUTES = 60;\n/**\n * Number of seconds in one hour.\n *\n * @type {number}\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 wp.date.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 wp.date.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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tS( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tz( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {number} Formatted date.\n\t */\n\tt( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tL( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {number} Formatted date.\n\t */\n\tB( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tI( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {number} Formatted date.\n\t */\n\tZ( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tr( momentDate ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return {string} Formatted date.\n */\nexport function format( dateFormat, dateValue = new Date() ) {\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 =\n\t\t\t\tformatMap[ /** @type {keyof formatMap} */ ( char ) ];\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string, parsable\n * by moment.js.\n * @param {string | number | undefined} 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( dateFormat, dateValue = new Date(), timezone ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return {string} Formatted date in English.\n */\nexport function gmdate( dateFormat, dateValue = new Date() ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string, parsable by\n * moment.js.\n * @param {string | number | boolean | undefined} 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 {string} Formatted date.\n */\nexport function dateI18n( dateFormat, dateValue = new Date(), timezone ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return {string} Formatted date.\n */\nexport function gmdateI18n( dateFormat, dateValue = new Date() ) {\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 {string} dateValue Date String or Date object in the Defined WP Timezone.\n *\n * @return {boolean} Is in the future.\n */\nexport function isInTheFuture( dateValue ) {\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 {string?} dateString Date formatted in the WP timezone.\n *\n * @return {Date} Date\n */\nexport function getDate( dateString ) {\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 {Moment | Date | string} from From date, in the WP timezone.\n * @param {Moment | Date | string | undefined} to To date, formatted in the WP timezone.\n *\n * @return {string} Human-readable time difference.\n */\nexport function humanTimeDiff( from, to ) {\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 {Moment | Date | string | undefined} dateValue Date object or string, parsable\n * by moment.js.\n * @param {string | number | undefined} 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 {Moment} a moment instance.\n */\nfunction buildMoment( dateValue, timezone = '' ) {\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( /** @type {string} */ ( timezone ) );\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 {number|string} offset a UTC offset.\n *\n * @return {boolean} whether a certain UTC offset is valid or not.\n */\nfunction isUTCOffset( offset ) {\n\tif ( 'number' === typeof offset ) {\n\t\treturn true;\n\t}\n\n\treturn VALID_UTC_OFFSET.test( offset );\n}\n\nsetupWPTimezone();\n"]}
|
|
1
|
+
{"version":3,"names":["_moment","_interopRequireDefault","require","_deprecated","WP_ZONE","VALID_UTC_OFFSET","settings","l10n","locale","months","monthsShort","weekdays","weekdaysShort","meridiem","am","pm","AM","PM","relative","future","past","s","ss","m","mm","h","hh","d","dd","M","MM","y","yy","startOfWeek","formats","time","date","datetime","datetimeAbbreviated","timezone","offset","string","abbr","setSettings","dateSettings","setupWPTimezone","momentLib","locales","includes","localeData","longDateFormat","defineLocale","currentLocale","parentLocale","hour","minute","isLowercase","LT","LTS","L","LL","LLL","LLLL","relativeTime","getSettings","__experimentalGetSettings","deprecated","since","alternative","tz","add","pack","name","abbrs","untils","offsets","MINUTE_IN_SECONDS","HOUR_IN_MINUTES","HOUR_IN_SECONDS","formatMap","D","j","l","N","S","momentDate","num","format","withOrdinal","replace","w","z","parseInt","toString","W","F","n","t","daysInMonth","isLeapYear","o","Y","a","A","B","timezoned","utcOffset","seconds","minutes","hours","g","G","H","i","u","v","e","I","isDST","O","P","T","Z","sign","parts","substring","split","map","c","r","U","dateFormat","dateValue","Date","char","newFormat","length","push","formatter","join","dateMoment","buildMoment","gmdate","utc","dateI18n","gmdateI18n","undefined","isInTheFuture","now","momentObject","isAfter","getDate","dateString","toDate","humanTimeDiff","from","to","fromMoment","toMoment","isUTCOffset","test"],"sources":["@wordpress/date/src/index.js"],"sourcesContent":["/**\n * External dependencies\n */\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/** @typedef {import('moment').Moment} Moment */\n/** @typedef {import('moment').LocaleSpecification} MomentLocaleSpecification */\n\n/**\n * @typedef MeridiemConfig\n * @property {string} am Lowercase AM.\n * @property {string} AM Uppercase AM.\n * @property {string} pm Lowercase PM.\n * @property {string} PM Uppercase PM.\n */\n\n/**\n * @typedef FormatsConfig\n * @property {string} time Time format.\n * @property {string} date Date format.\n * @property {string} datetime Datetime format.\n * @property {string} datetimeAbbreviated Abbreviated datetime format.\n */\n\n/**\n * @typedef TimezoneConfig\n * @property {string} offset Offset setting.\n * @property {string} string The timezone as a string (e.g., `'America/Los_Angeles'`).\n * @property {string} abbr Abbreviation for the timezone.\n */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * @typedef L10nSettings\n * @property {string} locale Moment locale.\n * @property {MomentLocaleSpecification['months']} months Locale months.\n * @property {MomentLocaleSpecification['monthsShort']} monthsShort Locale months short.\n * @property {MomentLocaleSpecification['weekdays']} weekdays Locale weekdays.\n * @property {MomentLocaleSpecification['weekdaysShort']} weekdaysShort Locale weekdays short.\n * @property {MeridiemConfig} meridiem Meridiem config.\n * @property {MomentLocaleSpecification['relativeTime']} relative Relative time config.\n * @property {0|1|2|3|4|5|6} startOfWeek Day that the week starts on.\n */\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @typedef DateSettings\n * @property {L10nSettings} l10n Localization settings.\n * @property {FormatsConfig} formats Date/time formats config.\n * @property {TimezoneConfig} timezone Timezone settings.\n */\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 made in `lib/client-assets.php` as\n// well because it uses the `setSettings()` function to change these settings.\n/** @type {DateSettings} */\nlet settings = {\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', string: '', abbr: '' },\n};\n\n/**\n * Adds a locale to moment, using the format supplied by `wp_localize_script()`.\n *\n * @param {DateSettings} dateSettings Settings, including locale data.\n */\nexport function setSettings( 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// Create WP timezone based off dateSettings.\n\tmomentLib.tz.add(\n\t\tmomentLib.tz.pack( {\n\t\t\tname: WP_ZONE,\n\t\t\tabbrs: [ WP_ZONE ],\n\t\t\tuntils: [ null ],\n\t\t\toffsets: [ -settings.timezone.offset * 60 || 0 ],\n\t\t} )\n\t);\n}\n\n// Date constants.\n/**\n * Number of seconds in one minute.\n *\n * @type {number}\n */\nconst MINUTE_IN_SECONDS = 60;\n/**\n * Number of minutes in one hour.\n *\n * @type {number}\n */\nconst HOUR_IN_MINUTES = 60;\n/**\n * Number of seconds in one hour.\n *\n * @type {number}\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 wp.date.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 wp.date.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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tS( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tz( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {number} Formatted date.\n\t */\n\tt( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tL( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {number} Formatted date.\n\t */\n\tB( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tI( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {number} Formatted date.\n\t */\n\tZ( momentDate ) {\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 {Moment} momentDate Moment instance.\n\t *\n\t * @return {string} Formatted date.\n\t */\n\tr( momentDate ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return {string} Formatted date.\n */\nexport function format( dateFormat, dateValue = new Date() ) {\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 =\n\t\t\t\tformatMap[ /** @type {keyof formatMap} */ ( char ) ];\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string, parsable\n * by moment.js.\n * @param {string | number | undefined} 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( dateFormat, dateValue = new Date(), timezone ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return {string} Formatted date in English.\n */\nexport function gmdate( dateFormat, dateValue = new Date() ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string, parsable by\n * moment.js.\n * @param {string | number | boolean | undefined} 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 {string} Formatted date.\n */\nexport function dateI18n( dateFormat, dateValue = new Date(), timezone ) {\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 {string} dateFormat PHP-style formatting string.\n * See php.net/date.\n * @param {Moment | Date | string | undefined} dateValue Date object or string,\n * parsable by moment.js.\n *\n * @return {string} Formatted date.\n */\nexport function gmdateI18n( dateFormat, dateValue = new Date() ) {\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 {string} dateValue Date String or Date object in the Defined WP Timezone.\n *\n * @return {boolean} Is in the future.\n */\nexport function isInTheFuture( dateValue ) {\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 {string?} dateString Date formatted in the WP timezone.\n *\n * @return {Date} Date\n */\nexport function getDate( dateString ) {\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 {Moment | Date | string} from From date, in the WP timezone.\n * @param {Moment | Date | string | undefined} to To date, formatted in the WP timezone.\n *\n * @return {string} Human-readable time difference.\n */\nexport function humanTimeDiff( from, to ) {\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 {Moment | Date | string | undefined} dateValue Date object or string, parsable\n * by moment.js.\n * @param {string | number | undefined} 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 {Moment} a moment instance.\n */\nfunction buildMoment( dateValue, timezone = '' ) {\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( /** @type {string} */ ( timezone ) );\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 {number|string} offset a UTC offset.\n *\n * @return {boolean} whether a certain UTC offset is valid or not.\n */\nfunction isUTCOffset( offset ) {\n\tif ( 'number' === typeof offset ) {\n\t\treturn true;\n\t}\n\n\treturn VALID_UTC_OFFSET.test( offset );\n}\n\nsetupWPTimezone();\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACAA,OAAA;AAKA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAME,OAAO,GAAG,IAAI;;AAEpB;AACA;AACA,MAAMC,gBAAgB,GAAG,iCAAiC;;AAE1D;AACA;AACA;AACA,IAAIC,QAAQ,GAAG;EACdC,IAAI,EAAE;IACLC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAE,CACP,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,CACV;IACDC,WAAW,EAAE,CACZ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAA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MAAM,EAAG;IACjC,OAAO,IAAI;EACZ;EAEA,OAAOnC,gBAAgB,CAAC2J,IAAI,CAAExH,MAAO,CAAC;AACvC;AAEAK,eAAe,CAAC,CAAC"}
|
package/build-module/index.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
import momentLib from 'moment';
|
|
5
5
|
import 'moment-timezone/moment-timezone';
|
|
6
6
|
import 'moment-timezone/moment-timezone-utils';
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* WordPress dependencies
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
11
|
import deprecated from '@wordpress/deprecated';
|
|
12
|
-
/** @typedef {import('moment').Moment} Moment */
|
|
13
12
|
|
|
13
|
+
/** @typedef {import('moment').Moment} Moment */
|
|
14
14
|
/** @typedef {import('moment').LocaleSpecification} MomentLocaleSpecification */
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -37,7 +37,6 @@ import deprecated from '@wordpress/deprecated';
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
/* eslint-disable jsdoc/valid-types */
|
|
40
|
-
|
|
41
40
|
/**
|
|
42
41
|
* @typedef L10nSettings
|
|
43
42
|
* @property {string} locale Moment locale.
|
|
@@ -49,7 +48,6 @@ import deprecated from '@wordpress/deprecated';
|
|
|
49
48
|
* @property {MomentLocaleSpecification['relativeTime']} relative Relative time config.
|
|
50
49
|
* @property {0|1|2|3|4|5|6} startOfWeek Day that the week starts on.
|
|
51
50
|
*/
|
|
52
|
-
|
|
53
51
|
/* eslint-enable jsdoc/valid-types */
|
|
54
52
|
|
|
55
53
|
/**
|
|
@@ -59,14 +57,15 @@ import deprecated from '@wordpress/deprecated';
|
|
|
59
57
|
* @property {TimezoneConfig} timezone Timezone settings.
|
|
60
58
|
*/
|
|
61
59
|
|
|
62
|
-
const WP_ZONE = 'WP';
|
|
60
|
+
const WP_ZONE = 'WP';
|
|
61
|
+
|
|
62
|
+
// This regular expression tests positive for UTC offsets as described in ISO 8601.
|
|
63
63
|
// See: https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC
|
|
64
|
+
const VALID_UTC_OFFSET = /^[+-][0-1][0-9](:?[0-9][0-9])?$/;
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
// Changes made here will likely need to be made in `lib/client-assets.php` as
|
|
66
67
|
// well because it uses the `setSettings()` function to change these settings.
|
|
67
|
-
|
|
68
68
|
/** @type {DateSettings} */
|
|
69
|
-
|
|
70
69
|
let settings = {
|
|
71
70
|
l10n: {
|
|
72
71
|
locale: 'en',
|
|
@@ -110,16 +109,17 @@ let settings = {
|
|
|
110
109
|
abbr: ''
|
|
111
110
|
}
|
|
112
111
|
};
|
|
112
|
+
|
|
113
113
|
/**
|
|
114
114
|
* Adds a locale to moment, using the format supplied by `wp_localize_script()`.
|
|
115
115
|
*
|
|
116
116
|
* @param {DateSettings} dateSettings Settings, including locale data.
|
|
117
117
|
*/
|
|
118
|
-
|
|
119
118
|
export function setSettings(dateSettings) {
|
|
120
119
|
settings = dateSettings;
|
|
121
|
-
setupWPTimezone();
|
|
120
|
+
setupWPTimezone();
|
|
122
121
|
|
|
122
|
+
// Does moment already have a locale with the right name?
|
|
123
123
|
if (momentLib.locales().includes(dateSettings.l10n.locale)) {
|
|
124
124
|
// Is that locale misconfigured, e.g. because we are on a site running
|
|
125
125
|
// WordPress < 6.0?
|
|
@@ -131,11 +131,12 @@ export function setSettings(dateSettings) {
|
|
|
131
131
|
// We have a properly configured locale, so no need to create one.
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
134
|
+
}
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
// defineLocale() will modify the current locale, so back it up.
|
|
137
|
+
const currentLocale = momentLib.locale();
|
|
138
138
|
|
|
139
|
+
// Create locale.
|
|
139
140
|
momentLib.defineLocale(dateSettings.l10n.locale, {
|
|
140
141
|
// Inherit anything missing from English. We don't load
|
|
141
142
|
// moment-with-locales.js so English is all there is.
|
|
@@ -144,15 +145,12 @@ export function setSettings(dateSettings) {
|
|
|
144
145
|
monthsShort: dateSettings.l10n.monthsShort,
|
|
145
146
|
weekdays: dateSettings.l10n.weekdays,
|
|
146
147
|
weekdaysShort: dateSettings.l10n.weekdaysShort,
|
|
147
|
-
|
|
148
148
|
meridiem(hour, minute, isLowercase) {
|
|
149
149
|
if (hour < 12) {
|
|
150
150
|
return isLowercase ? dateSettings.l10n.meridiem.am : dateSettings.l10n.meridiem.AM;
|
|
151
151
|
}
|
|
152
|
-
|
|
153
152
|
return isLowercase ? dateSettings.l10n.meridiem.pm : dateSettings.l10n.meridiem.PM;
|
|
154
153
|
},
|
|
155
|
-
|
|
156
154
|
longDateFormat: {
|
|
157
155
|
LT: dateSettings.formats.time,
|
|
158
156
|
LTS: momentLib.localeData('en').longDateFormat('LTS'),
|
|
@@ -164,26 +162,27 @@ export function setSettings(dateSettings) {
|
|
|
164
162
|
// From human_time_diff?
|
|
165
163
|
// Set to `(number, withoutSuffix, key, isFuture) => {}` instead.
|
|
166
164
|
relativeTime: dateSettings.l10n.relative
|
|
167
|
-
});
|
|
165
|
+
});
|
|
168
166
|
|
|
167
|
+
// Restore the locale to what it was.
|
|
169
168
|
momentLib.locale(currentLocale);
|
|
170
169
|
}
|
|
170
|
+
|
|
171
171
|
/**
|
|
172
172
|
* Returns the currently defined date settings.
|
|
173
173
|
*
|
|
174
174
|
* @return {DateSettings} Settings, including locale data.
|
|
175
175
|
*/
|
|
176
|
-
|
|
177
176
|
export function getSettings() {
|
|
178
177
|
return settings;
|
|
179
178
|
}
|
|
179
|
+
|
|
180
180
|
/**
|
|
181
181
|
* Returns the currently defined date settings.
|
|
182
182
|
*
|
|
183
183
|
* @deprecated
|
|
184
184
|
* @return {DateSettings} Settings, including locale data.
|
|
185
185
|
*/
|
|
186
|
-
|
|
187
186
|
export function __experimentalGetSettings() {
|
|
188
187
|
deprecated('wp.date.__experimentalGetSettings', {
|
|
189
188
|
since: '6.1',
|
|
@@ -191,7 +190,6 @@ export function __experimentalGetSettings() {
|
|
|
191
190
|
});
|
|
192
191
|
return getSettings();
|
|
193
192
|
}
|
|
194
|
-
|
|
195
193
|
function setupWPTimezone() {
|
|
196
194
|
// Create WP timezone based off dateSettings.
|
|
197
195
|
momentLib.tz.add(momentLib.tz.pack({
|
|
@@ -200,30 +198,28 @@ function setupWPTimezone() {
|
|
|
200
198
|
untils: [null],
|
|
201
199
|
offsets: [-settings.timezone.offset * 60 || 0]
|
|
202
200
|
}));
|
|
203
|
-
}
|
|
201
|
+
}
|
|
204
202
|
|
|
203
|
+
// Date constants.
|
|
205
204
|
/**
|
|
206
205
|
* Number of seconds in one minute.
|
|
207
206
|
*
|
|
208
207
|
* @type {number}
|
|
209
208
|
*/
|
|
210
|
-
|
|
211
|
-
|
|
212
209
|
const MINUTE_IN_SECONDS = 60;
|
|
213
210
|
/**
|
|
214
211
|
* Number of minutes in one hour.
|
|
215
212
|
*
|
|
216
213
|
* @type {number}
|
|
217
214
|
*/
|
|
218
|
-
|
|
219
215
|
const HOUR_IN_MINUTES = 60;
|
|
220
216
|
/**
|
|
221
217
|
* Number of seconds in one hour.
|
|
222
218
|
*
|
|
223
219
|
* @type {number}
|
|
224
220
|
*/
|
|
225
|
-
|
|
226
221
|
const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
|
|
222
|
+
|
|
227
223
|
/**
|
|
228
224
|
* Map of PHP formats to Moment.js formats.
|
|
229
225
|
*
|
|
@@ -234,7 +230,6 @@ const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
|
|
|
234
230
|
* This should only be used through {@link wp.date.format}, not
|
|
235
231
|
* directly.
|
|
236
232
|
*/
|
|
237
|
-
|
|
238
233
|
const formatMap = {
|
|
239
234
|
// Day.
|
|
240
235
|
d: 'DD',
|
|
@@ -242,7 +237,6 @@ const formatMap = {
|
|
|
242
237
|
j: 'D',
|
|
243
238
|
l: 'dddd',
|
|
244
239
|
N: 'E',
|
|
245
|
-
|
|
246
240
|
/**
|
|
247
241
|
* Gets the ordinal suffix.
|
|
248
242
|
*
|
|
@@ -256,9 +250,7 @@ const formatMap = {
|
|
|
256
250
|
const withOrdinal = momentDate.format('Do');
|
|
257
251
|
return withOrdinal.replace(num, '');
|
|
258
252
|
},
|
|
259
|
-
|
|
260
253
|
w: 'd',
|
|
261
|
-
|
|
262
254
|
/**
|
|
263
255
|
* Gets the day of the year (zero-indexed).
|
|
264
256
|
*
|
|
@@ -270,7 +262,6 @@ const formatMap = {
|
|
|
270
262
|
// DDD - 1.
|
|
271
263
|
return (parseInt(momentDate.format('DDD'), 10) - 1).toString();
|
|
272
264
|
},
|
|
273
|
-
|
|
274
265
|
// Week.
|
|
275
266
|
W: 'W',
|
|
276
267
|
// Month.
|
|
@@ -278,7 +269,6 @@ const formatMap = {
|
|
|
278
269
|
m: 'MM',
|
|
279
270
|
M: 'MMM',
|
|
280
271
|
n: 'M',
|
|
281
|
-
|
|
282
272
|
/**
|
|
283
273
|
* Gets the days in the month.
|
|
284
274
|
*
|
|
@@ -289,9 +279,7 @@ const formatMap = {
|
|
|
289
279
|
t(momentDate) {
|
|
290
280
|
return momentDate.daysInMonth();
|
|
291
281
|
},
|
|
292
|
-
|
|
293
282
|
// Year.
|
|
294
|
-
|
|
295
283
|
/**
|
|
296
284
|
* Gets whether the current year is a leap year.
|
|
297
285
|
*
|
|
@@ -302,14 +290,12 @@ const formatMap = {
|
|
|
302
290
|
L(momentDate) {
|
|
303
291
|
return momentDate.isLeapYear() ? '1' : '0';
|
|
304
292
|
},
|
|
305
|
-
|
|
306
293
|
o: 'GGGG',
|
|
307
294
|
Y: 'YYYY',
|
|
308
295
|
y: 'YY',
|
|
309
296
|
// Time.
|
|
310
297
|
a: 'a',
|
|
311
298
|
A: 'A',
|
|
312
|
-
|
|
313
299
|
/**
|
|
314
300
|
* Gets the current time in Swatch Internet Time (.beats).
|
|
315
301
|
*
|
|
@@ -320,11 +306,10 @@ const formatMap = {
|
|
|
320
306
|
B(momentDate) {
|
|
321
307
|
const timezoned = momentLib(momentDate).utcOffset(60);
|
|
322
308
|
const seconds = parseInt(timezoned.format('s'), 10),
|
|
323
|
-
|
|
324
|
-
|
|
309
|
+
minutes = parseInt(timezoned.format('m'), 10),
|
|
310
|
+
hours = parseInt(timezoned.format('H'), 10);
|
|
325
311
|
return parseInt(((seconds + minutes * MINUTE_IN_SECONDS + hours * HOUR_IN_SECONDS) / 86.4).toString(), 10);
|
|
326
312
|
},
|
|
327
|
-
|
|
328
313
|
g: 'h',
|
|
329
314
|
G: 'H',
|
|
330
315
|
h: 'hh',
|
|
@@ -335,7 +320,6 @@ const formatMap = {
|
|
|
335
320
|
v: 'SSS',
|
|
336
321
|
// Timezone.
|
|
337
322
|
e: 'zz',
|
|
338
|
-
|
|
339
323
|
/**
|
|
340
324
|
* Gets whether the timezone is in DST currently.
|
|
341
325
|
*
|
|
@@ -346,11 +330,9 @@ const formatMap = {
|
|
|
346
330
|
I(momentDate) {
|
|
347
331
|
return momentDate.isDST() ? '1' : '0';
|
|
348
332
|
},
|
|
349
|
-
|
|
350
333
|
O: 'ZZ',
|
|
351
334
|
P: 'Z',
|
|
352
335
|
T: 'z',
|
|
353
|
-
|
|
354
336
|
/**
|
|
355
337
|
* Gets the timezone offset in seconds.
|
|
356
338
|
*
|
|
@@ -365,12 +347,9 @@ const formatMap = {
|
|
|
365
347
|
const parts = offset.substring(1).split(':').map(n => parseInt(n, 10));
|
|
366
348
|
return sign * (parts[0] * HOUR_IN_MINUTES + parts[1]) * MINUTE_IN_SECONDS;
|
|
367
349
|
},
|
|
368
|
-
|
|
369
350
|
// Full date/time.
|
|
370
351
|
c: 'YYYY-MM-DDTHH:mm:ssZ',
|
|
371
|
-
|
|
372
352
|
// .toISOString.
|
|
373
|
-
|
|
374
353
|
/**
|
|
375
354
|
* Formats the date as RFC2822.
|
|
376
355
|
*
|
|
@@ -381,9 +360,9 @@ const formatMap = {
|
|
|
381
360
|
r(momentDate) {
|
|
382
361
|
return momentDate.locale('en').format('ddd, DD MMM YYYY HH:mm:ss ZZ');
|
|
383
362
|
},
|
|
384
|
-
|
|
385
363
|
U: 'X'
|
|
386
364
|
};
|
|
365
|
+
|
|
387
366
|
/**
|
|
388
367
|
* Formats a date. Does not alter the date's timezone.
|
|
389
368
|
*
|
|
@@ -394,27 +373,21 @@ const formatMap = {
|
|
|
394
373
|
*
|
|
395
374
|
* @return {string} Formatted date.
|
|
396
375
|
*/
|
|
397
|
-
|
|
398
376
|
export function format(dateFormat, dateValue = new Date()) {
|
|
399
377
|
let i, char;
|
|
400
378
|
const newFormat = [];
|
|
401
379
|
const momentDate = momentLib(dateValue);
|
|
402
|
-
|
|
403
380
|
for (i = 0; i < dateFormat.length; i++) {
|
|
404
|
-
char = dateFormat[i];
|
|
405
|
-
|
|
381
|
+
char = dateFormat[i];
|
|
382
|
+
// Is this an escape?
|
|
406
383
|
if ('\\' === char) {
|
|
407
384
|
// Add next character, then move on.
|
|
408
385
|
i++;
|
|
409
386
|
newFormat.push('[' + dateFormat[i] + ']');
|
|
410
387
|
continue;
|
|
411
388
|
}
|
|
412
|
-
|
|
413
389
|
if (char in formatMap) {
|
|
414
|
-
const formatter = formatMap[
|
|
415
|
-
/** @type {keyof formatMap} */
|
|
416
|
-
char];
|
|
417
|
-
|
|
390
|
+
const formatter = formatMap[/** @type {keyof formatMap} */char];
|
|
418
391
|
if (typeof formatter !== 'string') {
|
|
419
392
|
// If the format is a function, call it.
|
|
420
393
|
newFormat.push('[' + formatter(momentDate) + ']');
|
|
@@ -425,12 +398,12 @@ export function format(dateFormat, dateValue = new Date()) {
|
|
|
425
398
|
} else {
|
|
426
399
|
newFormat.push('[' + char + ']');
|
|
427
400
|
}
|
|
428
|
-
}
|
|
401
|
+
}
|
|
402
|
+
// Join with [] between to separate characters, and replace
|
|
429
403
|
// unneeded separators with static text.
|
|
430
|
-
|
|
431
|
-
|
|
432
404
|
return momentDate.format(newFormat.join('[]'));
|
|
433
405
|
}
|
|
406
|
+
|
|
434
407
|
/**
|
|
435
408
|
* Formats a date (like `date()` in PHP).
|
|
436
409
|
*
|
|
@@ -447,11 +420,11 @@ export function format(dateFormat, dateValue = new Date()) {
|
|
|
447
420
|
*
|
|
448
421
|
* @return {string} Formatted date in English.
|
|
449
422
|
*/
|
|
450
|
-
|
|
451
423
|
export function date(dateFormat, dateValue = new Date(), timezone) {
|
|
452
424
|
const dateMoment = buildMoment(dateValue, timezone);
|
|
453
425
|
return format(dateFormat, dateMoment);
|
|
454
426
|
}
|
|
427
|
+
|
|
455
428
|
/**
|
|
456
429
|
* Formats a date (like `date()` in PHP), in the UTC timezone.
|
|
457
430
|
*
|
|
@@ -462,11 +435,11 @@ export function date(dateFormat, dateValue = new Date(), timezone) {
|
|
|
462
435
|
*
|
|
463
436
|
* @return {string} Formatted date in English.
|
|
464
437
|
*/
|
|
465
|
-
|
|
466
438
|
export function gmdate(dateFormat, dateValue = new Date()) {
|
|
467
439
|
const dateMoment = momentLib(dateValue).utc();
|
|
468
440
|
return format(dateFormat, dateMoment);
|
|
469
441
|
}
|
|
442
|
+
|
|
470
443
|
/**
|
|
471
444
|
* Formats a date (like `wp_date()` in PHP), translating it into site's locale.
|
|
472
445
|
*
|
|
@@ -488,20 +461,18 @@ export function gmdate(dateFormat, dateValue = new Date()) {
|
|
|
488
461
|
*
|
|
489
462
|
* @return {string} Formatted date.
|
|
490
463
|
*/
|
|
491
|
-
|
|
492
464
|
export function dateI18n(dateFormat, dateValue = new Date(), timezone) {
|
|
493
465
|
if (true === timezone) {
|
|
494
466
|
return gmdateI18n(dateFormat, dateValue);
|
|
495
467
|
}
|
|
496
|
-
|
|
497
468
|
if (false === timezone) {
|
|
498
469
|
timezone = undefined;
|
|
499
470
|
}
|
|
500
|
-
|
|
501
471
|
const dateMoment = buildMoment(dateValue, timezone);
|
|
502
472
|
dateMoment.locale(settings.l10n.locale);
|
|
503
473
|
return format(dateFormat, dateMoment);
|
|
504
474
|
}
|
|
475
|
+
|
|
505
476
|
/**
|
|
506
477
|
* Formats a date (like `wp_date()` in PHP), translating it into site's locale
|
|
507
478
|
* and using the UTC timezone.
|
|
@@ -513,12 +484,12 @@ export function dateI18n(dateFormat, dateValue = new Date(), timezone) {
|
|
|
513
484
|
*
|
|
514
485
|
* @return {string} Formatted date.
|
|
515
486
|
*/
|
|
516
|
-
|
|
517
487
|
export function gmdateI18n(dateFormat, dateValue = new Date()) {
|
|
518
488
|
const dateMoment = momentLib(dateValue).utc();
|
|
519
489
|
dateMoment.locale(settings.l10n.locale);
|
|
520
490
|
return format(dateFormat, dateMoment);
|
|
521
491
|
}
|
|
492
|
+
|
|
522
493
|
/**
|
|
523
494
|
* Check whether a date is considered in the future according to the WordPress settings.
|
|
524
495
|
*
|
|
@@ -526,12 +497,12 @@ export function gmdateI18n(dateFormat, dateValue = new Date()) {
|
|
|
526
497
|
*
|
|
527
498
|
* @return {boolean} Is in the future.
|
|
528
499
|
*/
|
|
529
|
-
|
|
530
500
|
export function isInTheFuture(dateValue) {
|
|
531
501
|
const now = momentLib.tz(WP_ZONE);
|
|
532
502
|
const momentObject = momentLib.tz(dateValue, WP_ZONE);
|
|
533
503
|
return momentObject.isAfter(now);
|
|
534
504
|
}
|
|
505
|
+
|
|
535
506
|
/**
|
|
536
507
|
* Create and return a JavaScript Date Object from a date string in the WP timezone.
|
|
537
508
|
*
|
|
@@ -539,14 +510,13 @@ export function isInTheFuture(dateValue) {
|
|
|
539
510
|
*
|
|
540
511
|
* @return {Date} Date
|
|
541
512
|
*/
|
|
542
|
-
|
|
543
513
|
export function getDate(dateString) {
|
|
544
514
|
if (!dateString) {
|
|
545
515
|
return momentLib.tz(WP_ZONE).toDate();
|
|
546
516
|
}
|
|
547
|
-
|
|
548
517
|
return momentLib.tz(dateString, WP_ZONE).toDate();
|
|
549
518
|
}
|
|
519
|
+
|
|
550
520
|
/**
|
|
551
521
|
* Returns a human-readable time difference between two dates, like human_time_diff() in PHP.
|
|
552
522
|
*
|
|
@@ -555,12 +525,12 @@ export function getDate(dateString) {
|
|
|
555
525
|
*
|
|
556
526
|
* @return {string} Human-readable time difference.
|
|
557
527
|
*/
|
|
558
|
-
|
|
559
528
|
export function humanTimeDiff(from, to) {
|
|
560
529
|
const fromMoment = momentLib.tz(from, WP_ZONE);
|
|
561
530
|
const toMoment = to ? momentLib.tz(to, WP_ZONE) : momentLib.tz(WP_ZONE);
|
|
562
531
|
return fromMoment.from(toMoment);
|
|
563
532
|
}
|
|
533
|
+
|
|
564
534
|
/**
|
|
565
535
|
* Creates a moment instance using the given timezone or, if none is provided, using global settings.
|
|
566
536
|
*
|
|
@@ -575,27 +545,21 @@ export function humanTimeDiff(from, to) {
|
|
|
575
545
|
*
|
|
576
546
|
* @return {Moment} a moment instance.
|
|
577
547
|
*/
|
|
578
|
-
|
|
579
548
|
function buildMoment(dateValue, timezone = '') {
|
|
580
549
|
const dateMoment = momentLib(dateValue);
|
|
581
|
-
|
|
582
550
|
if (timezone && !isUTCOffset(timezone)) {
|
|
583
551
|
// The ! isUTCOffset() check guarantees that timezone is a string.
|
|
584
|
-
return dateMoment.tz(
|
|
585
|
-
/** @type {string} */
|
|
586
|
-
timezone);
|
|
552
|
+
return dateMoment.tz( /** @type {string} */timezone);
|
|
587
553
|
}
|
|
588
|
-
|
|
589
554
|
if (timezone && isUTCOffset(timezone)) {
|
|
590
555
|
return dateMoment.utcOffset(timezone);
|
|
591
556
|
}
|
|
592
|
-
|
|
593
557
|
if (settings.timezone.string) {
|
|
594
558
|
return dateMoment.tz(settings.timezone.string);
|
|
595
559
|
}
|
|
596
|
-
|
|
597
560
|
return dateMoment.utcOffset(+settings.timezone.offset);
|
|
598
561
|
}
|
|
562
|
+
|
|
599
563
|
/**
|
|
600
564
|
* Returns whether a certain UTC offset is valid or not.
|
|
601
565
|
*
|
|
@@ -603,15 +567,11 @@ function buildMoment(dateValue, timezone = '') {
|
|
|
603
567
|
*
|
|
604
568
|
* @return {boolean} whether a certain UTC offset is valid or not.
|
|
605
569
|
*/
|
|
606
|
-
|
|
607
|
-
|
|
608
570
|
function isUTCOffset(offset) {
|
|
609
571
|
if ('number' === typeof offset) {
|
|
610
572
|
return true;
|
|
611
573
|
}
|
|
612
|
-
|
|
613
574
|
return VALID_UTC_OFFSET.test(offset);
|
|
614
575
|
}
|
|
615
|
-
|
|
616
576
|
setupWPTimezone();
|
|
617
577
|
//# sourceMappingURL=index.js.map
|