@wordpress/date 4.3.1 → 4.3.2-next.a55ed9455a.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/build/index.js CHANGED
@@ -225,7 +225,7 @@ const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
225
225
  */
226
226
 
227
227
  const formatMap = {
228
- // Day
228
+ // Day.
229
229
  d: 'DD',
230
230
  D: 'ddd',
231
231
  j: 'D',
@@ -240,7 +240,7 @@ const formatMap = {
240
240
  * @return {string} Formatted date.
241
241
  */
242
242
  S(momentDate) {
243
- // Do - D
243
+ // Do - D.
244
244
  const num = momentDate.format('D');
245
245
  const withOrdinal = momentDate.format('Do');
246
246
  return withOrdinal.replace(num, '');
@@ -256,13 +256,13 @@ const formatMap = {
256
256
  * @return {string} Formatted date.
257
257
  */
258
258
  z(momentDate) {
259
- // DDD - 1
259
+ // DDD - 1.
260
260
  return (parseInt(momentDate.format('DDD'), 10) - 1).toString();
261
261
  },
262
262
 
263
- // Week
263
+ // Week.
264
264
  W: 'W',
265
- // Month
265
+ // Month.
266
266
  F: 'MMMM',
267
267
  m: 'MM',
268
268
  M: 'MMM',
@@ -279,7 +279,7 @@ const formatMap = {
279
279
  return momentDate.daysInMonth();
280
280
  },
281
281
 
282
- // Year
282
+ // Year.
283
283
 
284
284
  /**
285
285
  * Gets whether the current year is a leap year.
@@ -295,7 +295,7 @@ const formatMap = {
295
295
  o: 'GGGG',
296
296
  Y: 'YYYY',
297
297
  y: 'YY',
298
- // Time
298
+ // Time.
299
299
  a: 'a',
300
300
  A: 'A',
301
301
 
@@ -322,7 +322,7 @@ const formatMap = {
322
322
  s: 'ss',
323
323
  u: 'SSSSSS',
324
324
  v: 'SSS',
325
- // Timezone
325
+ // Timezone.
326
326
  e: 'zz',
327
327
 
328
328
  /**
@@ -355,9 +355,9 @@ const formatMap = {
355
355
  return sign * (parts[0] * HOUR_IN_MINUTES + parts[1]) * MINUTE_IN_SECONDS;
356
356
  },
357
357
 
358
- // Full date/time
358
+ // Full date/time.
359
359
  c: 'YYYY-MM-DDTHH:mm:ssZ',
360
- // .toISOString
360
+ // .toISOString.
361
361
  r: 'ddd, D MMM YYYY HH:mm:ss ZZ',
362
362
  U: 'X'
363
363
  };
@@ -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","formats","time","date","datetime","datetimeAbbreviated","timezone","offset","string","abbr","setSettings","dateSettings","currentLocale","momentLib","updateLocale","parentLocale","hour","minute","isLowercase","longDateFormat","LT","LTS","L","LL","LLL","LLLL","relativeTime","setupWPTimezone","__experimentalGetSettings","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","isUTCOffset","test"],"mappings":";;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAMA,OAAO,GAAG,IAAhB,C,CAEA;AACA;;A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AzB,EAAkC;AACjC,WAAO,IAAP;AACA;;AAED,SAAOlC,gBAAgB,CAAC8I,IAAjB,CAAuB5G,MAAvB,CAAP;AACA;;AAEDoB,eAAe","sourcesContent":["/**\n * External dependencies\n */\nimport momentLib from 'moment';\nimport 'moment-timezone/moment-timezone';\nimport 'moment-timezone/moment-timezone-utils';\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 */\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},\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\t// Backup and restore current locale.\n\tconst currentLocale = momentLib.locale();\n\tmomentLib.updateLocale( dateSettings.l10n.locale, {\n\t\t// Inherit anything missing from the default locale.\n\t\tparentLocale: currentLocale,\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\t// @ts-ignore Forcing this to `null`\n\t\t\tLTS: null,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tL: null,\n\t\t\tLL: dateSettings.formats.date,\n\t\t\tLLL: dateSettings.formats.datetime,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tLLLL: null,\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\tmomentLib.locale( currentLocale );\n\n\tsetupWPTimezone();\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @return {Object} Settings, including locale data.\n */\nexport function __experimentalGetSettings() {\n\treturn settings;\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\tr: 'ddd, D MMM YYYY HH:mm:ss ZZ',\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 | 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 | 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 * 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 | 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\treturn dateMoment.tz( 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,"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","formats","time","date","datetime","datetimeAbbreviated","timezone","offset","string","abbr","setSettings","dateSettings","currentLocale","momentLib","updateLocale","parentLocale","hour","minute","isLowercase","longDateFormat","LT","LTS","L","LL","LLL","LLLL","relativeTime","setupWPTimezone","__experimentalGetSettings","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","isUTCOffset","test"],"mappings":";;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;;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;;AAEA;AACA;AACA;AACA;AACA;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CAAsB3G,MAAtB,EAA+B;AAC9B,MAAK,aAAa,OAAOA,MAAzB,EAAkC;AACjC,WAAO,IAAP;AACA;;AAED,SAAOlC,gBAAgB,CAAC8I,IAAjB,CAAuB5G,MAAvB,CAAP;AACA;;AAEDoB,eAAe","sourcesContent":["/**\n * External dependencies\n */\nimport momentLib from 'moment';\nimport 'moment-timezone/moment-timezone';\nimport 'moment-timezone/moment-timezone-utils';\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 */\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},\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\t// Backup and restore current locale.\n\tconst currentLocale = momentLib.locale();\n\tmomentLib.updateLocale( dateSettings.l10n.locale, {\n\t\t// Inherit anything missing from the default locale.\n\t\tparentLocale: currentLocale,\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\t// @ts-ignore Forcing this to `null`\n\t\t\tLTS: null,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tL: null,\n\t\t\tLL: dateSettings.formats.date,\n\t\t\tLLL: dateSettings.formats.datetime,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tLLLL: null,\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\tmomentLib.locale( currentLocale );\n\n\tsetupWPTimezone();\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @return {Object} Settings, including locale data.\n */\nexport function __experimentalGetSettings() {\n\treturn settings;\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\tr: 'ddd, D MMM YYYY HH:mm:ss ZZ',\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 | 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 | 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 * 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 | 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\treturn dateMoment.tz( 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"]}
@@ -201,7 +201,7 @@ const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
201
201
  */
202
202
 
203
203
  const formatMap = {
204
- // Day
204
+ // Day.
205
205
  d: 'DD',
206
206
  D: 'ddd',
207
207
  j: 'D',
@@ -216,7 +216,7 @@ const formatMap = {
216
216
  * @return {string} Formatted date.
217
217
  */
218
218
  S(momentDate) {
219
- // Do - D
219
+ // Do - D.
220
220
  const num = momentDate.format('D');
221
221
  const withOrdinal = momentDate.format('Do');
222
222
  return withOrdinal.replace(num, '');
@@ -232,13 +232,13 @@ const formatMap = {
232
232
  * @return {string} Formatted date.
233
233
  */
234
234
  z(momentDate) {
235
- // DDD - 1
235
+ // DDD - 1.
236
236
  return (parseInt(momentDate.format('DDD'), 10) - 1).toString();
237
237
  },
238
238
 
239
- // Week
239
+ // Week.
240
240
  W: 'W',
241
- // Month
241
+ // Month.
242
242
  F: 'MMMM',
243
243
  m: 'MM',
244
244
  M: 'MMM',
@@ -255,7 +255,7 @@ const formatMap = {
255
255
  return momentDate.daysInMonth();
256
256
  },
257
257
 
258
- // Year
258
+ // Year.
259
259
 
260
260
  /**
261
261
  * Gets whether the current year is a leap year.
@@ -271,7 +271,7 @@ const formatMap = {
271
271
  o: 'GGGG',
272
272
  Y: 'YYYY',
273
273
  y: 'YY',
274
- // Time
274
+ // Time.
275
275
  a: 'a',
276
276
  A: 'A',
277
277
 
@@ -298,7 +298,7 @@ const formatMap = {
298
298
  s: 'ss',
299
299
  u: 'SSSSSS',
300
300
  v: 'SSS',
301
- // Timezone
301
+ // Timezone.
302
302
  e: 'zz',
303
303
 
304
304
  /**
@@ -331,9 +331,9 @@ const formatMap = {
331
331
  return sign * (parts[0] * HOUR_IN_MINUTES + parts[1]) * MINUTE_IN_SECONDS;
332
332
  },
333
333
 
334
- // Full date/time
334
+ // Full date/time.
335
335
  c: 'YYYY-MM-DDTHH:mm:ssZ',
336
- // .toISOString
336
+ // .toISOString.
337
337
  r: 'ddd, D MMM YYYY HH:mm:ss ZZ',
338
338
  U: 'X'
339
339
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/date/src/index.js"],"names":["momentLib","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","formats","time","date","datetime","datetimeAbbreviated","timezone","offset","string","abbr","setSettings","dateSettings","currentLocale","updateLocale","parentLocale","hour","minute","isLowercase","longDateFormat","LT","LTS","L","LL","LLL","LLLL","relativeTime","setupWPTimezone","__experimentalGetSettings","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","isUTCOffset","test"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,SAAP,MAAsB,QAAtB;AACA,OAAO,iCAAP;AACA,OAAO,uCAAP;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA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AAP;AACA;;AAED,MAAKhC,QAAQ,CAACgC,QAAT,CAAkBE,MAAvB,EAAgC;AAC/B,WAAO2F,UAAU,CAACvE,EAAX,CAAetD,QAAQ,CAACgC,QAAT,CAAkBE,MAAjC,CAAP;AACA;;AAED,SAAO2F,UAAU,CAAClC,SAAX,CAAsB3F,QAAQ,CAACgC,QAAT,CAAkBC,MAAxC,CAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS0G,WAAT,CAAsB1G,MAAtB,EAA+B;AAC9B,MAAK,aAAa,OAAOA,MAAzB,EAAkC;AACjC,WAAO,IAAP;AACA;;AAED,SAAOlC,gBAAgB,CAAC6I,IAAjB,CAAuB3G,MAAvB,CAAP;AACA;;AAEDmB,eAAe","sourcesContent":["/**\n * External dependencies\n */\nimport momentLib from 'moment';\nimport 'moment-timezone/moment-timezone';\nimport 'moment-timezone/moment-timezone-utils';\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 */\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},\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\t// Backup and restore current locale.\n\tconst currentLocale = momentLib.locale();\n\tmomentLib.updateLocale( dateSettings.l10n.locale, {\n\t\t// Inherit anything missing from the default locale.\n\t\tparentLocale: currentLocale,\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\t// @ts-ignore Forcing this to `null`\n\t\t\tLTS: null,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tL: null,\n\t\t\tLL: dateSettings.formats.date,\n\t\t\tLLL: dateSettings.formats.datetime,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tLLLL: null,\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\tmomentLib.locale( currentLocale );\n\n\tsetupWPTimezone();\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @return {Object} Settings, including locale data.\n */\nexport function __experimentalGetSettings() {\n\treturn settings;\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\tr: 'ddd, D MMM YYYY HH:mm:ss ZZ',\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 | 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 | 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 * 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 | 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\treturn dateMoment.tz( 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,"sources":["@wordpress/date/src/index.js"],"names":["momentLib","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","formats","time","date","datetime","datetimeAbbreviated","timezone","offset","string","abbr","setSettings","dateSettings","currentLocale","updateLocale","parentLocale","hour","minute","isLowercase","longDateFormat","LT","LTS","L","LL","LLL","LLLL","relativeTime","setupWPTimezone","__experimentalGetSettings","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","isUTCOffset","test"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,SAAP,MAAsB,QAAtB;AACA,OAAO,iCAAP;AACA,OAAO,uCAAP;AAEA;;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;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,OAAO,GAAG,IAAhB,C,CAEA;AACA;;AACA,MAAMC,gBAAgB,GAAG,iCAAzB,C,CAEA;AACA;;AACA;;AACA,IAAIC,QAAQ,GAAG;AACdC,EAAAA,IAAI,EAAE;AACLC,IAAAA,MAAM,EAAE,IADH;AAELC,IAAAA,MAAM,EAAE,CACP,SADO,EAEP,UAFO,EAGP,OAHO,EAIP,OAJO,EAKP,KALO,EAMP,MANO,EAOP,MAPO,EAQP,QARO,EASP,WATO,EAUP,SAVO,EAWP,UAXO,EAYP,UAZO,CAFH;AAgBLC,IAAAA,WAAW,EAAE,CACZ,KADY,EAEZ,KAFY,EAGZ,KAHY,EAIZ,KAJY,EAKZ,KALY,EAMZ,KANY,EAOZ,KAPY,EAQZ,KARY,EASZ,KATY,EAUZ,KAVY,EAWZ,KAXY,EAYZ,KAZY,CAhBR;AA8BLC,IAAAA,QAAQ,EAAE,CACT,QADS,EAET,QAFS,EAGT,SAHS,EAIT,WAJS,EAKT,UALS,EAMT,QANS,EAOT,UAPS,CA9BL;AAuCLC,IAAAA,aAAa,EAAE,CAAE,KAAF,EAAS,KAAT,EAAgB,KAAhB,EAAuB,KAAvB,EAA8B,KAA9B,EAAqC,KAArC,EAA4C,KAA5C,CAvCV;AAwCLC,IAAAA,QAAQ,EAAE;AAAEC,MAAAA,EAAE,EAAE,IAAN;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AAKrF,QAAQ,IAAI,CAAE2G,WAAW,CAAE3G,QAAF,CAA9B,EAA6C;AAC5C,WAAO6F,UAAU,CAACvE,EAAX,CAAetB,QAAf,CAAP;AACA;;AAED,MAAKA,QAAQ,IAAI2G,WAAW,CAAE3G,QAAF,CAA5B,EAA2C;AAC1C,WAAO6F,UAAU,CAAClC,SAAX,CAAsB3D,QAAtB,CAAP;AACA;;AAED,MAAKhC,QAAQ,CAACgC,QAAT,CAAkBE,MAAvB,EAAgC;AAC/B,WAAO2F,UAAU,CAACvE,EAAX,CAAetD,QAAQ,CAACgC,QAAT,CAAkBE,MAAjC,CAAP;AACA;;AAED,SAAO2F,UAAU,CAAClC,SAAX,CAAsB3F,QAAQ,CAACgC,QAAT,CAAkBC,MAAxC,CAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS0G,WAAT,CAAsB1G,MAAtB,EAA+B;AAC9B,MAAK,aAAa,OAAOA,MAAzB,EAAkC;AACjC,WAAO,IAAP;AACA;;AAED,SAAOlC,gBAAgB,CAAC6I,IAAjB,CAAuB3G,MAAvB,CAAP;AACA;;AAEDmB,eAAe","sourcesContent":["/**\n * External dependencies\n */\nimport momentLib from 'moment';\nimport 'moment-timezone/moment-timezone';\nimport 'moment-timezone/moment-timezone-utils';\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 */\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},\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\t// Backup and restore current locale.\n\tconst currentLocale = momentLib.locale();\n\tmomentLib.updateLocale( dateSettings.l10n.locale, {\n\t\t// Inherit anything missing from the default locale.\n\t\tparentLocale: currentLocale,\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\t// @ts-ignore Forcing this to `null`\n\t\t\tLTS: null,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tL: null,\n\t\t\tLL: dateSettings.formats.date,\n\t\t\tLLL: dateSettings.formats.datetime,\n\t\t\t// @ts-ignore Forcing this to `null`\n\t\t\tLLLL: null,\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\tmomentLib.locale( currentLocale );\n\n\tsetupWPTimezone();\n}\n\n/**\n * Returns the currently defined date settings.\n *\n * @return {Object} Settings, including locale data.\n */\nexport function __experimentalGetSettings() {\n\treturn settings;\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\tr: 'ddd, D MMM YYYY HH:mm:ss ZZ',\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 | 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 | 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 * 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 | 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\treturn dateMoment.tz( 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/date",
3
- "version": "4.3.1",
3
+ "version": "4.3.2-next.a55ed9455a.0",
4
4
  "description": "Date module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
36
+ "gitHead": "c5108185851b824d531bce55991a3589947e8551"
37
37
  }
package/src/index.js CHANGED
@@ -227,7 +227,7 @@ const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
227
227
  * directly.
228
228
  */
229
229
  const formatMap = {
230
- // Day
230
+ // Day.
231
231
  d: 'DD',
232
232
  D: 'ddd',
233
233
  j: 'D',
@@ -242,7 +242,7 @@ const formatMap = {
242
242
  * @return {string} Formatted date.
243
243
  */
244
244
  S( momentDate ) {
245
- // Do - D
245
+ // Do - D.
246
246
  const num = momentDate.format( 'D' );
247
247
  const withOrdinal = momentDate.format( 'Do' );
248
248
  return withOrdinal.replace( num, '' );
@@ -257,14 +257,14 @@ const formatMap = {
257
257
  * @return {string} Formatted date.
258
258
  */
259
259
  z( momentDate ) {
260
- // DDD - 1
260
+ // DDD - 1.
261
261
  return ( parseInt( momentDate.format( 'DDD' ), 10 ) - 1 ).toString();
262
262
  },
263
263
 
264
- // Week
264
+ // Week.
265
265
  W: 'W',
266
266
 
267
- // Month
267
+ // Month.
268
268
  F: 'MMMM',
269
269
  m: 'MM',
270
270
  M: 'MMM',
@@ -280,7 +280,7 @@ const formatMap = {
280
280
  return momentDate.daysInMonth();
281
281
  },
282
282
 
283
- // Year
283
+ // Year.
284
284
  /**
285
285
  * Gets whether the current year is a leap year.
286
286
  *
@@ -295,7 +295,7 @@ const formatMap = {
295
295
  Y: 'YYYY',
296
296
  y: 'YY',
297
297
 
298
- // Time
298
+ // Time.
299
299
  a: 'a',
300
300
  A: 'A',
301
301
  /**
@@ -328,7 +328,7 @@ const formatMap = {
328
328
  s: 'ss',
329
329
  u: 'SSSSSS',
330
330
  v: 'SSS',
331
- // Timezone
331
+ // Timezone.
332
332
  e: 'zz',
333
333
  /**
334
334
  * Gets whether the timezone is in DST currently.
@@ -364,8 +364,8 @@ const formatMap = {
364
364
  MINUTE_IN_SECONDS
365
365
  );
366
366
  },
367
- // Full date/time
368
- c: 'YYYY-MM-DDTHH:mm:ssZ', // .toISOString
367
+ // Full date/time.
368
+ c: 'YYYY-MM-DDTHH:mm:ssZ', // .toISOString.
369
369
  r: 'ddd, D MMM YYYY HH:mm:ss ZZ',
370
370
  U: 'X',
371
371
  };
package/src/test/index.js CHANGED
@@ -30,7 +30,7 @@ describe( 'isInTheFuture', () => {
30
30
  it( 'should ignore the timezone', () => {
31
31
  const settings = __experimentalGetSettings();
32
32
 
33
- // Set a timezone in the future
33
+ // Set a timezone in the future.
34
34
  setSettings( {
35
35
  ...settings,
36
36
  timezone: { offset: '4', string: '' },
@@ -43,7 +43,7 @@ describe( 'isInTheFuture', () => {
43
43
  date = new Date( Number( getDate() ) + 1000 * 60 );
44
44
  expect( isInTheFuture( date ) ).toBe( true );
45
45
 
46
- // Restore default settings
46
+ // Restore default settings.
47
47
  setSettings( settings );
48
48
  } );
49
49
  } );
@@ -52,7 +52,7 @@ describe( 'Function date', () => {
52
52
  it( 'should format date in English, ignoring locale settings', () => {
53
53
  const settings = __experimentalGetSettings();
54
54
 
55
- // Simulate different locale
55
+ // Simulate different locale.
56
56
  const l10n = settings.l10n;
57
57
  setSettings( {
58
58
  ...settings,
@@ -70,27 +70,27 @@ describe( 'Function date', () => {
70
70
  },
71
71
  } );
72
72
 
73
- // Check
73
+ // Check.
74
74
  const formattedDate = dateNoI18n(
75
75
  'F M l D',
76
76
  '2019-06-18T11:00:00.000Z'
77
77
  );
78
78
  expect( formattedDate ).toBe( 'June Jun Tuesday Tue' );
79
79
 
80
- // Restore default settings
80
+ // Restore default settings.
81
81
  setSettings( settings );
82
82
  } );
83
83
 
84
84
  it( 'should format date into a date that uses site’s timezone, if no timezone was provided and there’s a site timezone set', () => {
85
85
  const settings = __experimentalGetSettings();
86
86
 
87
- // Simulate different timezone
87
+ // Simulate different timezone.
88
88
  setSettings( {
89
89
  ...settings,
90
90
  timezone: { offset: -4, string: 'America/New_York' },
91
91
  } );
92
92
 
93
- // Check
93
+ // Check.
94
94
  const winterFormattedDate = dateNoI18n(
95
95
  'Y-m-d H:i',
96
96
  '2019-01-18T11:00:00.000Z'
@@ -103,20 +103,20 @@ describe( 'Function date', () => {
103
103
  );
104
104
  expect( summerFormattedDate ).toBe( '2019-06-18 07:00' );
105
105
 
106
- // Restore default settings
106
+ // Restore default settings.
107
107
  setSettings( settings );
108
108
  } );
109
109
 
110
110
  it( 'should format date into a date that uses site’s UTC offset setting, if no timezone was provided and there isn’t a timezone set in the site', () => {
111
111
  const settings = __experimentalGetSettings();
112
112
 
113
- // Simulate different timezone
113
+ // Simulate different timezone.
114
114
  setSettings( {
115
115
  ...settings,
116
116
  timezone: { offset: -4, string: '' },
117
117
  } );
118
118
 
119
- // Check
119
+ // Check.
120
120
  const winterFormattedDate = dateNoI18n(
121
121
  'Y-m-d H:i',
122
122
  '2019-01-18T11:00:00.000Z'
@@ -129,20 +129,20 @@ describe( 'Function date', () => {
129
129
  );
130
130
  expect( summerFormattedDate ).toBe( '2019-06-18 07:00' );
131
131
 
132
- // Restore default settings
132
+ // Restore default settings.
133
133
  setSettings( settings );
134
134
  } );
135
135
 
136
136
  it( 'should format date into a date that uses the given timezone, if said timezone is valid', () => {
137
137
  const settings = __experimentalGetSettings();
138
138
 
139
- // Simulate different timezone
139
+ // Simulate different timezone.
140
140
  setSettings( {
141
141
  ...settings,
142
142
  timezone: { offset: -4, string: 'America/New_York' },
143
143
  } );
144
144
 
145
- // Check
145
+ // Check.
146
146
  const formattedDate = dateNoI18n(
147
147
  'Y-m-d H:i',
148
148
  '2019-06-18T11:00:00.000Z',
@@ -150,20 +150,20 @@ describe( 'Function date', () => {
150
150
  );
151
151
  expect( formattedDate ).toBe( '2019-06-18 19:00' );
152
152
 
153
- // Restore default settings
153
+ // Restore default settings.
154
154
  setSettings( settings );
155
155
  } );
156
156
 
157
157
  it( 'should format date into a date that uses the given UTC offset, if given timezone is actually a UTC offset', () => {
158
158
  const settings = __experimentalGetSettings();
159
159
 
160
- // Simulate different timezone
160
+ // Simulate different timezone.
161
161
  setSettings( {
162
162
  ...settings,
163
163
  timezone: { offset: -4, string: 'America/New_York' },
164
164
  } );
165
165
 
166
- // Check
166
+ // Check.
167
167
  let formattedDate;
168
168
  formattedDate = dateNoI18n(
169
169
  'Y-m-d H:i',
@@ -186,7 +186,7 @@ describe( 'Function date', () => {
186
186
  );
187
187
  expect( formattedDate ).toBe( '2019-06-18 19:00' );
188
188
 
189
- // Restore default settings
189
+ // Restore default settings.
190
190
  setSettings( settings );
191
191
  } );
192
192
  } );
@@ -195,7 +195,7 @@ describe( 'Function gmdate', () => {
195
195
  it( 'should format date in English, ignoring locale settings', () => {
196
196
  const settings = __experimentalGetSettings();
197
197
 
198
- // Simulate different locale
198
+ // Simulate different locale.
199
199
  const l10n = settings.l10n;
200
200
  setSettings( {
201
201
  ...settings,
@@ -213,28 +213,28 @@ describe( 'Function gmdate', () => {
213
213
  },
214
214
  } );
215
215
 
216
- // Check
216
+ // Check.
217
217
  const formattedDate = gmdate( 'F M l D', '2019-06-18T11:00:00.000Z' );
218
218
  expect( formattedDate ).toBe( 'June Jun Tuesday Tue' );
219
219
 
220
- // Restore default settings
220
+ // Restore default settings.
221
221
  setSettings( settings );
222
222
  } );
223
223
 
224
224
  it( 'should format date into a UTC date', () => {
225
225
  const settings = __experimentalGetSettings();
226
226
 
227
- // Simulate different timezone
227
+ // Simulate different timezone.
228
228
  setSettings( {
229
229
  ...settings,
230
230
  timezone: { offset: -4, string: 'America/New_York' },
231
231
  } );
232
232
 
233
- // Check
233
+ // Check.
234
234
  const formattedDate = gmdate( 'Y-m-d H:i', '2019-06-18T11:00:00.000Z' );
235
235
  expect( formattedDate ).toBe( '2019-06-18 11:00' );
236
236
 
237
- // Restore default settings
237
+ // Restore default settings.
238
238
  setSettings( settings );
239
239
  } );
240
240
  } );
@@ -243,7 +243,7 @@ describe( 'Function dateI18n', () => {
243
243
  it( 'should format date using locale settings', () => {
244
244
  const settings = __experimentalGetSettings();
245
245
 
246
- // Simulate different locale
246
+ // Simulate different locale.
247
247
  const l10n = settings.l10n;
248
248
  setSettings( {
249
249
  ...settings,
@@ -261,7 +261,7 @@ describe( 'Function dateI18n', () => {
261
261
  },
262
262
  } );
263
263
 
264
- // Check
264
+ // Check.
265
265
  const formattedDate = dateI18n(
266
266
  'F M l D',
267
267
  '2019-06-18T11:00:00.000Z',
@@ -269,20 +269,20 @@ describe( 'Function dateI18n', () => {
269
269
  );
270
270
  expect( formattedDate ).toBe( 'es_June es_Jun es_Tuesday es_Tue' );
271
271
 
272
- // Restore default settings
272
+ // Restore default settings.
273
273
  setSettings( settings );
274
274
  } );
275
275
 
276
276
  it( 'should format date into a date that uses site’s timezone, if no timezone was provided and there’s a site timezone set', () => {
277
277
  const settings = __experimentalGetSettings();
278
278
 
279
- // Simulate different timezone
279
+ // Simulate different timezone.
280
280
  setSettings( {
281
281
  ...settings,
282
282
  timezone: { offset: -4, string: 'America/New_York' },
283
283
  } );
284
284
 
285
- // Check
285
+ // Check.
286
286
  const winterFormattedDate = dateI18n(
287
287
  'Y-m-d H:i',
288
288
  '2019-01-18T11:00:00.000Z'
@@ -295,20 +295,20 @@ describe( 'Function dateI18n', () => {
295
295
  );
296
296
  expect( summerFormattedDate ).toBe( '2019-06-18 07:00' );
297
297
 
298
- // Restore default settings
298
+ // Restore default settings.
299
299
  setSettings( settings );
300
300
  } );
301
301
 
302
302
  it( 'should format date into a date that uses site’s UTC offset setting, if no timezone was provided and there isn’t a timezone set in the site', () => {
303
303
  const settings = __experimentalGetSettings();
304
304
 
305
- // Simulate different timezone
305
+ // Simulate different timezone.
306
306
  setSettings( {
307
307
  ...settings,
308
308
  timezone: { offset: -4, string: '' },
309
309
  } );
310
310
 
311
- // Check
311
+ // Check.
312
312
  const winterFormattedDate = dateI18n(
313
313
  'Y-m-d H:i',
314
314
  '2019-01-18T11:00:00.000Z'
@@ -321,20 +321,20 @@ describe( 'Function dateI18n', () => {
321
321
  );
322
322
  expect( summerFormattedDate ).toBe( '2019-06-18 07:00' );
323
323
 
324
- // Restore default settings
324
+ // Restore default settings.
325
325
  setSettings( settings );
326
326
  } );
327
327
 
328
328
  it( 'should format date into a date that uses the given timezone, if said timezone is valid', () => {
329
329
  const settings = __experimentalGetSettings();
330
330
 
331
- // Simulate different timezone
331
+ // Simulate different timezone.
332
332
  setSettings( {
333
333
  ...settings,
334
334
  timezone: { offset: -4, string: 'America/New_York' },
335
335
  } );
336
336
 
337
- // Check
337
+ // Check.
338
338
  const formattedDate = dateI18n(
339
339
  'Y-m-d H:i',
340
340
  '2019-06-18T11:00:00.000Z',
@@ -342,20 +342,20 @@ describe( 'Function dateI18n', () => {
342
342
  );
343
343
  expect( formattedDate ).toBe( '2019-06-18 19:00' );
344
344
 
345
- // Restore default settings
345
+ // Restore default settings.
346
346
  setSettings( settings );
347
347
  } );
348
348
 
349
349
  it( 'should format date into a date that uses the given UTC offset, if given timezone is actually a UTC offset', () => {
350
350
  const settings = __experimentalGetSettings();
351
351
 
352
- // Simulate different timezone
352
+ // Simulate different timezone.
353
353
  setSettings( {
354
354
  ...settings,
355
355
  timezone: { offset: -4, string: 'America/New_York' },
356
356
  } );
357
357
 
358
- // Check
358
+ // Check.
359
359
  let formattedDate;
360
360
  formattedDate = dateI18n(
361
361
  'Y-m-d H:i',
@@ -374,20 +374,20 @@ describe( 'Function dateI18n', () => {
374
374
  );
375
375
  expect( formattedDate ).toBe( '2019-06-18 19:00' );
376
376
 
377
- // Restore default settings
377
+ // Restore default settings.
378
378
  setSettings( settings );
379
379
  } );
380
380
 
381
381
  it( 'should format date into a UTC date if `gmt` is set to `true`', () => {
382
382
  const settings = __experimentalGetSettings();
383
383
 
384
- // Simulate different timezone
384
+ // Simulate different timezone.
385
385
  setSettings( {
386
386
  ...settings,
387
387
  timezone: { offset: -4, string: 'America/New_York' },
388
388
  } );
389
389
 
390
- // Check
390
+ // Check.
391
391
  const formattedDate = dateI18n(
392
392
  'Y-m-d H:i',
393
393
  '2019-06-18T11:00:00.000Z',
@@ -395,20 +395,20 @@ describe( 'Function dateI18n', () => {
395
395
  );
396
396
  expect( formattedDate ).toBe( '2019-06-18 11:00' );
397
397
 
398
- // Restore default settings
398
+ // Restore default settings.
399
399
  setSettings( settings );
400
400
  } );
401
401
 
402
402
  it( 'should format date into a date that uses site’s timezone if `gmt` is set to `false`', () => {
403
403
  const settings = __experimentalGetSettings();
404
404
 
405
- // Simulate different timezone
405
+ // Simulate different timezone.
406
406
  setSettings( {
407
407
  ...settings,
408
408
  timezone: { offset: -4, string: 'America/New_York' },
409
409
  } );
410
410
 
411
- // Check
411
+ // Check.
412
412
  const formattedDate = dateI18n(
413
413
  'Y-m-d H:i',
414
414
  '2019-06-18T11:00:00.000Z',
@@ -416,7 +416,7 @@ describe( 'Function dateI18n', () => {
416
416
  );
417
417
  expect( formattedDate ).toBe( '2019-06-18 07:00' );
418
418
 
419
- // Restore default settings
419
+ // Restore default settings.
420
420
  setSettings( settings );
421
421
  } );
422
422
  } );
@@ -425,7 +425,7 @@ describe( 'Function gmdateI18n', () => {
425
425
  it( 'should format date using locale settings', () => {
426
426
  const settings = __experimentalGetSettings();
427
427
 
428
- // Simulate different locale
428
+ // Simulate different locale.
429
429
  const l10n = settings.l10n;
430
430
  setSettings( {
431
431
  ...settings,
@@ -443,34 +443,34 @@ describe( 'Function gmdateI18n', () => {
443
443
  },
444
444
  } );
445
445
 
446
- // Check
446
+ // Check.
447
447
  const formattedDate = gmdateI18n(
448
448
  'F M l D',
449
449
  '2019-06-18T11:00:00.000Z'
450
450
  );
451
451
  expect( formattedDate ).toBe( 'es_June es_Jun es_Tuesday es_Tue' );
452
452
 
453
- // Restore default settings
453
+ // Restore default settings.
454
454
  setSettings( settings );
455
455
  } );
456
456
 
457
457
  it( 'should format date into a UTC date', () => {
458
458
  const settings = __experimentalGetSettings();
459
459
 
460
- // Simulate different timezone
460
+ // Simulate different timezone.
461
461
  setSettings( {
462
462
  ...settings,
463
463
  timezone: { offset: -4, string: 'America/New_York' },
464
464
  } );
465
465
 
466
- // Check
466
+ // Check.
467
467
  const formattedDate = gmdateI18n(
468
468
  'Y-m-d H:i',
469
469
  '2019-06-18T11:00:00.000Z'
470
470
  );
471
471
  expect( formattedDate ).toBe( '2019-06-18 11:00' );
472
472
 
473
- // Restore default settings
473
+ // Restore default settings.
474
474
  setSettings( settings );
475
475
  } );
476
476
  } );
@@ -502,7 +502,7 @@ describe( 'Moment.js Localization', () => {
502
502
  expect( newSettings.l10n.relative.mm ).toBe( '%d localized minutes' );
503
503
  expect( newSettings.l10n.relative.hh ).toBe( '%d localized hours' );
504
504
 
505
- // Restore default settings
505
+ // Restore default settings.
506
506
  setSettings( settings );
507
507
  } );
508
508
  } );
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/moment/moment.d.ts","../../node_modules/moment-timezone/index.d.ts","../../node_modules/moment-timezone/moment-timezone-utils.d.ts","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"f2b43a96a09d31d1be3aab9a84311b407b72b8e3705af970f2e8f9173aacb470","8621a7b709bc463d5ab5a96d95bae465323fbf80b8a3d9eff5d2d6b60c795dd1","d6c98241d79795637aeabaf26de83c65890de10a79dd18039fc32d380212f42e","210e3a782a4a6fa4969be8b7a161b2677eec6ee508aaf7081cd5bb0abb6a3fba"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":false,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[45,47],[45,46]],"referencedMap":[[46,1],[47,2],[48,1]],"exportedModulesMap":[[46,1],[47,2],[48,1]],"semanticDiagnosticsPerFile":[46,47,45,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,48]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/moment/moment.d.ts","../../node_modules/moment-timezone/index.d.ts","../../node_modules/moment-timezone/moment-timezone-utils.d.ts","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"f2b43a96a09d31d1be3aab9a84311b407b72b8e3705af970f2e8f9173aacb470","8621a7b709bc463d5ab5a96d95bae465323fbf80b8a3d9eff5d2d6b60c795dd1","d6c98241d79795637aeabaf26de83c65890de10a79dd18039fc32d380212f42e","84ae6e80ce1f6c8d00397ddbb6909b4d01164f804706bd09ed1de481ed01a57e"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":false,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[45,47],[45,46]],"referencedMap":[[46,1],[47,2],[48,1]],"exportedModulesMap":[[46,1],[47,2],[48,1]],"semanticDiagnosticsPerFile":[46,47,45,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,48]},"version":"4.4.2"}