date-vir 2.0.0 → 4.0.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/dist/cjs/date-operations/diff-dates.js +57 -18
- package/dist/cjs/duration.js +39 -0
- package/dist/cjs/extra-utils/has-date-props.js +25 -0
- package/dist/cjs/extra-utils/js-date-conversion.js +2 -2
- package/dist/cjs/extra-utils/now.js +2 -2
- package/dist/cjs/formatting/formatted-string.js +34 -0
- package/dist/cjs/formatting/html-input.js +37 -0
- package/dist/cjs/formatting/relative-string.js +52 -0
- package/dist/cjs/formatting/simple-strings.js +58 -0
- package/dist/cjs/formatting/timestamp.js +21 -0
- package/dist/cjs/index.js +7 -2
- package/dist/esm/date-operations/diff-dates.d.ts +22 -20
- package/dist/esm/date-operations/diff-dates.js +55 -17
- package/dist/esm/duration.d.ts +50 -6
- package/dist/esm/duration.js +38 -1
- package/dist/esm/extra-utils/has-date-props.d.ts +8 -0
- package/dist/esm/extra-utils/has-date-props.js +20 -0
- package/dist/esm/extra-utils/js-date-conversion.js +1 -1
- package/dist/esm/extra-utils/now.d.ts +1 -1
- package/dist/esm/extra-utils/now.js +1 -1
- package/dist/esm/extra-utils/zero.d.ts +1 -1
- package/dist/esm/formatting/formatted-string.d.ts +14 -0
- package/dist/esm/formatting/formatted-string.js +29 -0
- package/dist/esm/{full-date/primitive-conversions.d.ts → formatting/html-input.d.ts} +2 -19
- package/dist/esm/formatting/html-input.js +33 -0
- package/dist/esm/formatting/relative-string.d.ts +25 -0
- package/dist/esm/formatting/relative-string.js +48 -0
- package/dist/esm/formatting/simple-strings.d.ts +71 -0
- package/dist/esm/formatting/simple-strings.js +51 -0
- package/dist/esm/formatting/timestamp.d.ts +6 -0
- package/dist/esm/formatting/timestamp.js +16 -0
- package/dist/esm/full-date/full-date-shape.d.ts +4 -4
- package/dist/esm/index.d.ts +7 -2
- package/dist/esm/index.js +7 -2
- package/package.json +33 -31
- package/public/index.css +7 -0
- package/dist/cjs/full-date/primitive-conversions.js +0 -102
- package/dist/esm/full-date/primitive-conversions.js +0 -94
- package/docs-dist/assets/highlight.css +0 -92
- package/docs-dist/assets/main.js +0 -59
- package/docs-dist/assets/navigation.js +0 -1
- package/docs-dist/assets/search.js +0 -1
- package/docs-dist/assets/style.css +0 -1383
- package/docs-dist/enums/DiffUnit.html +0 -126
- package/docs-dist/enums/FullDatePartEnum.html +0 -102
- package/docs-dist/functions/assertIsValidFullDate.html +0 -72
- package/docs-dist/functions/assertValidTimezone.html +0 -78
- package/docs-dist/functions/calculateRelativeDate.html +0 -78
- package/docs-dist/functions/clearParts.html +0 -74
- package/docs-dist/functions/clearTime.html +0 -72
- package/docs-dist/functions/combineDateParts.html +0 -197
- package/docs-dist/functions/createFullDate.html +0 -89
- package/docs-dist/functions/createFullDateInUserTimezone.html +0 -72
- package/docs-dist/functions/createUtcFullDate.html +0 -72
- package/docs-dist/functions/diffDates.html +0 -84
- package/docs-dist/functions/getNowFullDate.html +0 -77
- package/docs-dist/functions/getNowInIsoString.html +0 -67
- package/docs-dist/functions/getNowInUserTimezone.html +0 -67
- package/docs-dist/functions/hasTimezone.html +0 -79
- package/docs-dist/functions/isDateAfter.html +0 -77
- package/docs-dist/functions/isValidFullDate.html +0 -72
- package/docs-dist/functions/isValidIsoString.html +0 -72
- package/docs-dist/functions/isValidTimezone.html +0 -78
- package/docs-dist/functions/overrideDateParts.html +0 -77
- package/docs-dist/functions/parseInputElementValue.html +0 -83
- package/docs-dist/functions/parseLuxonDateTime.html +0 -84
- package/docs-dist/functions/parseStrangeString.html +0 -96
- package/docs-dist/functions/toFormattedString.html +0 -82
- package/docs-dist/functions/toHtmlInputString.html +0 -193
- package/docs-dist/functions/toIsoString.html +0 -75
- package/docs-dist/functions/toJsDate.html +0 -72
- package/docs-dist/functions/toLocaleString.html +0 -77
- package/docs-dist/functions/toLuxonDateTime.html +0 -77
- package/docs-dist/functions/toNewTimezone.html +0 -83
- package/docs-dist/functions/toTimestamp.html +0 -75
- package/docs-dist/modules.html +0 -139
- package/docs-dist/types/AnyDuration.html +0 -66
- package/docs-dist/types/DateFullDateKeys.html +0 -63
- package/docs-dist/types/DateLike.html +0 -66
- package/docs-dist/types/DatePart.html +0 -68
- package/docs-dist/types/DateTimeString.html +0 -63
- package/docs-dist/types/DateTimeWithSeconds.html +0 -63
- package/docs-dist/types/Duration.html +0 -73
- package/docs-dist/types/FullDate.html +0 -77
- package/docs-dist/types/JustDateString.html +0 -63
- package/docs-dist/types/JustTimeString.html +0 -63
- package/docs-dist/types/JustTimeWithSecondsString.html +0 -63
- package/docs-dist/types/MaybeDatePart.html +0 -66
- package/docs-dist/types/MaybeTuple.html +0 -68
- package/docs-dist/types/OnlyDatePart.html +0 -63
- package/docs-dist/types/OnlyHourMinutePart.html +0 -63
- package/docs-dist/types/OnlyHourMinuteSecondPart.html +0 -63
- package/docs-dist/types/TimeFullDateKeys.html +0 -63
- package/docs-dist/types/TimePart.html +0 -68
- package/docs-dist/types/Timezone.html +0 -63
- package/docs-dist/types/Timezones.html +0 -63
- package/docs-dist/types/UtcIsoString.html +0 -63
- package/docs-dist/types/UtcTimezone.html +0 -63
- package/docs-dist/variables/allTimezoneNames.html +0 -68
- package/docs-dist/variables/dateFullDateKeys-1.html +0 -63
- package/docs-dist/variables/datePartShape.html +0 -89
- package/docs-dist/variables/formatPresets.html +0 -114
- package/docs-dist/variables/fullDateShape.html +0 -63
- package/docs-dist/variables/timeFullDateKeys-1.html +0 -63
- package/docs-dist/variables/timePartShape.html +0 -91
- package/docs-dist/variables/timezones-1.html +0 -1005
- package/docs-dist/variables/userLocale.html +0 -63
- package/docs-dist/variables/userTimezone.html +0 -66
- package/docs-dist/variables/utcTimezone-1.html +0 -66
- package/docs-dist/variables/zeroDate.html +0 -80
- package/docs-dist/variables/zeroTime.html +0 -63
- /package/dist/cjs/{full-date → formatting}/string-format-types.js +0 -0
- /package/dist/esm/{full-date → formatting}/string-format-types.d.ts +0 -0
- /package/dist/esm/{full-date → formatting}/string-format-types.js +0 -0
package/dist/esm/duration.js
CHANGED
|
@@ -1 +1,38 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var DurationUnit;
|
|
2
|
+
(function (DurationUnit) {
|
|
3
|
+
DurationUnit["Years"] = "years";
|
|
4
|
+
DurationUnit["Quarters"] = "quarters";
|
|
5
|
+
DurationUnit["Months"] = "months";
|
|
6
|
+
DurationUnit["Weeks"] = "weeks";
|
|
7
|
+
DurationUnit["Days"] = "days";
|
|
8
|
+
DurationUnit["Hours"] = "hours";
|
|
9
|
+
DurationUnit["Minutes"] = "minutes";
|
|
10
|
+
DurationUnit["Seconds"] = "seconds";
|
|
11
|
+
DurationUnit["Milliseconds"] = "milliseconds";
|
|
12
|
+
})(DurationUnit || (DurationUnit = {}));
|
|
13
|
+
export const singularDurationUnitNames = {
|
|
14
|
+
[DurationUnit.Milliseconds]: 'millisecond',
|
|
15
|
+
[DurationUnit.Seconds]: 'second',
|
|
16
|
+
[DurationUnit.Minutes]: 'minute',
|
|
17
|
+
[DurationUnit.Hours]: 'hour',
|
|
18
|
+
[DurationUnit.Days]: 'day',
|
|
19
|
+
[DurationUnit.Weeks]: 'week',
|
|
20
|
+
[DurationUnit.Months]: 'month',
|
|
21
|
+
[DurationUnit.Quarters]: 'quarter',
|
|
22
|
+
[DurationUnit.Years]: 'year',
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Array of DurationUnit values: from smallest unit (milliseconds at index 0) to longest unit
|
|
26
|
+
* (years).
|
|
27
|
+
*/
|
|
28
|
+
export const orderedDurationUnits = [
|
|
29
|
+
DurationUnit.Milliseconds,
|
|
30
|
+
DurationUnit.Seconds,
|
|
31
|
+
DurationUnit.Minutes,
|
|
32
|
+
DurationUnit.Hours,
|
|
33
|
+
DurationUnit.Days,
|
|
34
|
+
DurationUnit.Weeks,
|
|
35
|
+
DurationUnit.Months,
|
|
36
|
+
DurationUnit.Quarters,
|
|
37
|
+
DurationUnit.Years,
|
|
38
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PartialAndUndefined, RequiredAndNotNullBy } from '@augment-vir/common';
|
|
2
|
+
import { FullDate } from '../full-date/full-date-shape';
|
|
3
|
+
export declare function hasDateProps<PartialFullDate extends PartialAndUndefined<FullDate>,
|
|
4
|
+
/** A union of strings. */
|
|
5
|
+
RequiredKeysUnion extends keyof FullDate>(dateInput: PartialAndUndefined<FullDate>, keys: ReadonlyArray<RequiredKeysUnion>): dateInput is RequiredAndNotNullBy<PartialFullDate, RequiredKeysUnion>;
|
|
6
|
+
export declare function assertHasDateProps<PartialFullDate extends PartialAndUndefined<FullDate>,
|
|
7
|
+
/** A union of strings. */
|
|
8
|
+
RequiredKeysUnion extends keyof FullDate>(dateInput: PartialAndUndefined<FullDate>, keys: ReadonlyArray<RequiredKeysUnion>): asserts dateInput is RequiredAndNotNullBy<PartialFullDate, RequiredKeysUnion>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function hasDateProps(dateInput, keys) {
|
|
2
|
+
try {
|
|
3
|
+
assertHasDateProps(dateInput, keys);
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function assertHasDateProps(dateInput, keys) {
|
|
11
|
+
const missingKeys = [];
|
|
12
|
+
keys.forEach((key) => {
|
|
13
|
+
if (dateInput[key] == undefined) {
|
|
14
|
+
missingKeys.push(key);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
if (missingKeys.length) {
|
|
18
|
+
throw new Error(`Missing required FullDate key(s): ${missingKeys.join(', ')}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { UtcIsoString } from '../formatting/string-format-types';
|
|
1
2
|
import { FullDate } from '../full-date/full-date-shape';
|
|
2
|
-
import { UtcIsoString } from '../full-date/string-format-types';
|
|
3
3
|
export declare function getNowInIsoString(): UtcIsoString;
|
|
4
4
|
export declare function getNowInUserTimezone(): FullDate;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { toIsoString } from '../formatting/timestamp';
|
|
1
2
|
import { getNowFullDate } from '../full-date/create-full-date';
|
|
2
|
-
import { toIsoString } from '../full-date/primitive-conversions';
|
|
3
3
|
import { userTimezone, utcTimezone } from '../timezone/timezones';
|
|
4
4
|
export function getNowInIsoString() {
|
|
5
5
|
/**
|
|
@@ -16,6 +16,6 @@ export declare const zeroTime: Pick<{
|
|
|
16
16
|
minute: 0;
|
|
17
17
|
second: 0;
|
|
18
18
|
millisecond: 0;
|
|
19
|
-
}, "
|
|
19
|
+
}, "millisecond" | "second" | "minute" | "hour">;
|
|
20
20
|
export declare function clearTime(inputFullDate: Readonly<FullDate>): FullDate;
|
|
21
21
|
export declare function clearParts(inputFullDate: Readonly<FullDate>, parts: ReadonlyArray<Exclude<keyof FullDate, 'timezone'>>): FullDate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PartialAndUndefined } from '@augment-vir/common';
|
|
2
|
+
import { FullDate } from '../full-date/full-date-shape';
|
|
3
|
+
/** Converts the given FullDate into a string in the user's locale, or the given localeOverride. */
|
|
4
|
+
export declare function toLocaleString(fullDate: FullDate, formatOptions?: (Intl.DateTimeFormatOptions & PartialAndUndefined<{
|
|
5
|
+
locale: string;
|
|
6
|
+
}>) | undefined): string;
|
|
7
|
+
/**
|
|
8
|
+
* Provides arbitrary date formatting using Luxon. For full details on the options for the format
|
|
9
|
+
* string input, see https://moment.github.io/luxon/#/formatting?id=table-of-tokens
|
|
10
|
+
*
|
|
11
|
+
* You probably should **prefer toLocaleString** so your users see the format they expect. It
|
|
12
|
+
* already has many formatting options.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toFormattedString(fullDate: FullDate, format: string, localeOverride?: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { toLuxonDateTime } from '../full-date/luxon-date-time-conversion';
|
|
2
|
+
import { userLocale } from '../locales';
|
|
3
|
+
/**
|
|
4
|
+
* Chromium has a weird behavior where the "NARROW NO-BREAK SPACE" character (code 8239) is used
|
|
5
|
+
* instead of a space (code 32) before AM/PM.
|
|
6
|
+
*/
|
|
7
|
+
function fixChromiumSpace(original) {
|
|
8
|
+
return original.replace(new RegExp(String.fromCharCode(8239), 'g'), ' ');
|
|
9
|
+
}
|
|
10
|
+
/** Converts the given FullDate into a string in the user's locale, or the given localeOverride. */
|
|
11
|
+
export function toLocaleString(fullDate, formatOptions) {
|
|
12
|
+
const localeString = toLuxonDateTime(fullDate).toLocaleString({
|
|
13
|
+
...formatOptions,
|
|
14
|
+
}, {
|
|
15
|
+
locale: formatOptions?.locale ?? userLocale,
|
|
16
|
+
});
|
|
17
|
+
return fixChromiumSpace(localeString);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Provides arbitrary date formatting using Luxon. For full details on the options for the format
|
|
21
|
+
* string input, see https://moment.github.io/luxon/#/formatting?id=table-of-tokens
|
|
22
|
+
*
|
|
23
|
+
* You probably should **prefer toLocaleString** so your users see the format they expect. It
|
|
24
|
+
* already has many formatting options.
|
|
25
|
+
*/
|
|
26
|
+
export function toFormattedString(fullDate, format, localeOverride = userLocale) {
|
|
27
|
+
const formattedString = toLuxonDateTime(fullDate).toFormat(format, { locale: localeOverride });
|
|
28
|
+
return fixChromiumSpace(formattedString);
|
|
29
|
+
}
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { DateTimeString, DateTimeWithSeconds, JustDateString, JustTimeString, JustTimeWithSecondsString, UtcIsoString } from './string-format-types';
|
|
4
|
-
/** Convert a FullDate into a unix timestamp with milliseconds. */
|
|
5
|
-
export declare function toTimestamp(fullDate: FullDate): number;
|
|
6
|
-
/** Convert a FullDate into an ISO string in UTC; always ends in Z. */
|
|
7
|
-
export declare function toIsoString(fullDate: FullDate): UtcIsoString;
|
|
8
|
-
/** Converts the given FullDate into a string in the user's locale, or the given localeOverride. */
|
|
9
|
-
export declare function toLocaleString(fullDate: FullDate, formatOptions?: (Intl.DateTimeFormatOptions & PartialAndUndefined<{
|
|
10
|
-
locale: string;
|
|
11
|
-
}>) | undefined): string;
|
|
12
|
-
/**
|
|
13
|
-
* Provides arbitrary date formatting using Luxon. For full details on the options for the format
|
|
14
|
-
* string input, see https://moment.github.io/luxon/#/formatting?id=table-of-tokens
|
|
15
|
-
*
|
|
16
|
-
* You probably should **prefer toLocaleString** so your users see the format they expect. It
|
|
17
|
-
* already has many formatting options.
|
|
18
|
-
*/
|
|
19
|
-
export declare function toFormattedString(fullDate: FullDate, format: string, localeOverride?: string): string;
|
|
1
|
+
import { FullDate, FullDatePartEnum, OnlyDatePart, OnlyHourMinutePart, OnlyHourMinuteSecondPart } from '../full-date/full-date-shape';
|
|
2
|
+
import { DateTimeString, DateTimeWithSeconds, JustDateString, JustTimeString, JustTimeWithSecondsString } from './string-format-types';
|
|
20
3
|
/**
|
|
21
4
|
* Converts a FullDate object into a string that is understood by type="date" or type="time"
|
|
22
5
|
* HTMLInputElement instances. Can optionally include seconds as well for type="time".
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getEnumTypedValues } from '@augment-vir/common';
|
|
2
|
+
import { assertHasDateProps } from '../extra-utils/has-date-props';
|
|
3
|
+
import { FullDatePartEnum, } from '../full-date/full-date-shape';
|
|
4
|
+
import { toSimpleDatePartString, toSimpleTimePartString } from './simple-strings';
|
|
5
|
+
export function toHtmlInputString(fullDate, inputType, includeSeconds) {
|
|
6
|
+
const internalFullDate = fullDate;
|
|
7
|
+
if (inputType === FullDatePartEnum.Date) {
|
|
8
|
+
assertHasDateProps(internalFullDate, [
|
|
9
|
+
'year',
|
|
10
|
+
'month',
|
|
11
|
+
'day',
|
|
12
|
+
]);
|
|
13
|
+
return toSimpleDatePartString(internalFullDate);
|
|
14
|
+
}
|
|
15
|
+
else if (inputType === FullDatePartEnum.Time) {
|
|
16
|
+
if (includeSeconds && internalFullDate.second == undefined) {
|
|
17
|
+
throw new Error('Tried to include seconds in the time string but no seconds were provided.');
|
|
18
|
+
}
|
|
19
|
+
assertHasDateProps(internalFullDate, [
|
|
20
|
+
'hour',
|
|
21
|
+
'minute',
|
|
22
|
+
]);
|
|
23
|
+
return toSimpleTimePartString(internalFullDate, !!includeSeconds);
|
|
24
|
+
}
|
|
25
|
+
else if (inputType === FullDatePartEnum.DateTime) {
|
|
26
|
+
const datePart = toHtmlInputString(fullDate, FullDatePartEnum.Date);
|
|
27
|
+
const timePart = toHtmlInputString(fullDate, FullDatePartEnum.Time, includeSeconds);
|
|
28
|
+
return `${datePart}T${timePart}`;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new Error(`Unexpected inputTyped: '${inputType}'. Expected usage of FullDatePartEnum or one of ${getEnumTypedValues(FullDatePartEnum).join(', ')}.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PartialAndUndefined } from '@augment-vir/common';
|
|
2
|
+
import { DurationUnit } from '../duration';
|
|
3
|
+
import { FullDate } from '../full-date/full-date-shape';
|
|
4
|
+
export type RelativeStringOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* The relative units that the relative string function is not allowed to use. By default, all
|
|
7
|
+
* units are allowed. Thus, you can use this to selectively disable some of them.
|
|
8
|
+
*/
|
|
9
|
+
blockedRelativeUnits: ReadonlyArray<DurationUnit>;
|
|
10
|
+
/**
|
|
11
|
+
* The number of digits to round the relative number value to. Defaults to 0, meaning there will
|
|
12
|
+
* be no decimal digits.
|
|
13
|
+
*
|
|
14
|
+
* Example output: {decimalDigitCount: 4} can result in values like 5.6789 whereas
|
|
15
|
+
* {decimalDigitCount: 0} will result in values like 6.
|
|
16
|
+
*/
|
|
17
|
+
decimalDigitCount: number;
|
|
18
|
+
/** Set this to true to block the 'just now' relative string. By default, that string is allowed. */
|
|
19
|
+
blockJustNow: true;
|
|
20
|
+
};
|
|
21
|
+
export declare function toRelativeString({ fullDate, relativeTo, options, }: {
|
|
22
|
+
fullDate: Readonly<FullDate>;
|
|
23
|
+
relativeTo: Readonly<FullDate>;
|
|
24
|
+
options?: PartialAndUndefined<RelativeStringOptions>;
|
|
25
|
+
}): string | undefined;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mapObjectValues, round } from '@augment-vir/common';
|
|
2
|
+
import { diffDatesAllUnits } from '../date-operations/diff-dates';
|
|
3
|
+
import { DurationUnit, orderedDurationUnits, singularDurationUnitNames } from '../duration';
|
|
4
|
+
export function toRelativeString({ fullDate, relativeTo, options = {}, }) {
|
|
5
|
+
const allUnitDiffs = diffDatesAllUnits({
|
|
6
|
+
start: fullDate,
|
|
7
|
+
end: relativeTo,
|
|
8
|
+
});
|
|
9
|
+
const unitsWithinBounds = mapObjectValues(allUnitDiffs, (durationUnit, duration) => {
|
|
10
|
+
const isAboveZero = Math.floor(Math.abs(duration)) > 0;
|
|
11
|
+
return isAboveZero;
|
|
12
|
+
});
|
|
13
|
+
const unitToUse = orderedDurationUnits.reduce((chosenUnit, currentUnit) => {
|
|
14
|
+
const isUnitAllowed = !options.blockedRelativeUnits?.includes(currentUnit);
|
|
15
|
+
if (isUnitAllowed && unitsWithinBounds[currentUnit]) {
|
|
16
|
+
return currentUnit;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return chosenUnit;
|
|
20
|
+
}
|
|
21
|
+
}, undefined);
|
|
22
|
+
const shouldUseJustNow = options.blockJustNow
|
|
23
|
+
? false
|
|
24
|
+
: (unitToUse === DurationUnit.Minutes && allUnitDiffs.minutes < 2) ||
|
|
25
|
+
(unitToUse === DurationUnit.Seconds && allUnitDiffs.seconds < 11) ||
|
|
26
|
+
(unitToUse === DurationUnit.Milliseconds && allUnitDiffs.milliseconds < 710);
|
|
27
|
+
/** Some short circuits. */
|
|
28
|
+
if (unitToUse == undefined) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
else if (shouldUseJustNow) {
|
|
32
|
+
return 'just now';
|
|
33
|
+
}
|
|
34
|
+
const duration = allUnitDiffs[unitToUse];
|
|
35
|
+
const roundedAbsoluteDuration = Math.abs(round({ digits: options.decimalDigitCount || 0, number: duration }));
|
|
36
|
+
const isDurationSingular = roundedAbsoluteDuration === 1;
|
|
37
|
+
const unitName = [
|
|
38
|
+
singularDurationUnitNames[unitToUse],
|
|
39
|
+
isDurationSingular ? '' : 's',
|
|
40
|
+
].join('');
|
|
41
|
+
const value = isDurationSingular ? 'a' : roundedAbsoluteDuration;
|
|
42
|
+
if (duration < 0) {
|
|
43
|
+
return `in ${value} ${unitName}`;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return `${value} ${unitName} ago`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FullDate } from '../full-date/full-date-shape';
|
|
2
|
+
import { JustDateString, JustTimeString, JustTimeWithSecondsString } from './string-format-types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a string based on just the date parts of a FullDate.
|
|
5
|
+
*
|
|
6
|
+
* CAUTION: this does not user locale setting and should therefore not be used for user-facing date
|
|
7
|
+
* formatting. Prefer using `toLocaleString` instead for user-facing strings.
|
|
8
|
+
*
|
|
9
|
+
* Example output: `'2023-12-05'`
|
|
10
|
+
*/
|
|
11
|
+
export declare function toSimpleDatePartString(fullDate: Pick<FullDate, 'year' | 'month' | 'day'>): JustDateString;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a string based on just the time parts of a FullDate.
|
|
14
|
+
*
|
|
15
|
+
* CAUTION: this does not user locale setting and should therefore not be used for user-facing date
|
|
16
|
+
* formatting. Prefer using `toLocaleString` instead for user-facing strings.
|
|
17
|
+
*
|
|
18
|
+
* Example output: `'05:32:21'`
|
|
19
|
+
*/
|
|
20
|
+
export declare function toSimpleTimePartString(fullDate: Pick<FullDate, 'hour' | 'minute' | 'second'>, includeSeconds: true): JustTimeWithSecondsString;
|
|
21
|
+
export declare function toSimpleTimePartString(fullDate: Pick<FullDate, 'hour' | 'minute'>, includeSeconds: false): JustTimeString;
|
|
22
|
+
export declare function toSimpleTimePartString(fullDate: Pick<FullDate, 'hour' | 'minute' | 'second'> | Pick<FullDate, 'hour' | 'minute'>, includeSeconds: boolean): JustTimeWithSecondsString | JustTimeString;
|
|
23
|
+
export type FullDateForParts = Omit<FullDate, 'millisecond'>;
|
|
24
|
+
/**
|
|
25
|
+
* Splits a FullDate up into multiple formatted string representations.
|
|
26
|
+
*
|
|
27
|
+
* CAUTION: this does not user locale setting and should therefore not be used for user-facing date
|
|
28
|
+
* formatting. Prefer using `toLocaleString` instead for user-facing strings.
|
|
29
|
+
*
|
|
30
|
+
* This does not expand month names into the full names, it just uses numbers for everything. The
|
|
31
|
+
* output of this will look like:
|
|
32
|
+
*
|
|
33
|
+
* ```typescript
|
|
34
|
+
* {
|
|
35
|
+
* "date": "2012-12-05",
|
|
36
|
+
* "time": "05:32:21",
|
|
37
|
+
* "timezone": "UTC"
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function toSimplePartStrings(fullDate: FullDateForParts, options: {
|
|
42
|
+
includeSeconds: true;
|
|
43
|
+
}): {
|
|
44
|
+
date: JustDateString;
|
|
45
|
+
time: JustTimeWithSecondsString;
|
|
46
|
+
timezone: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function toSimplePartStrings(fullDate: FullDateForParts, options: {
|
|
49
|
+
includeSeconds: false;
|
|
50
|
+
}): {
|
|
51
|
+
date: JustDateString;
|
|
52
|
+
time: JustTimeString;
|
|
53
|
+
timezone: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function toSimplePartStrings(fullDate: FullDateForParts, options: {
|
|
56
|
+
includeSeconds: boolean;
|
|
57
|
+
}): {
|
|
58
|
+
date: JustDateString;
|
|
59
|
+
time: JustTimeWithSecondsString | JustTimeString;
|
|
60
|
+
timezone: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Converts a date into a simple, unambiguous date string.
|
|
64
|
+
*
|
|
65
|
+
* CAUTION: this does not user locale setting and should therefore not be used for user-facing date
|
|
66
|
+
* formatting. Prefer using `toLocaleString` instead for user-facing strings.
|
|
67
|
+
*/
|
|
68
|
+
export declare function toSimpleString(fullDate: FullDateForParts, options: {
|
|
69
|
+
includeSeconds: boolean;
|
|
70
|
+
includeTimezone: boolean;
|
|
71
|
+
}): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isTruthy, typedHasProperty } from '@augment-vir/common';
|
|
2
|
+
/**
|
|
3
|
+
* Create a string based on just the date parts of a FullDate.
|
|
4
|
+
*
|
|
5
|
+
* CAUTION: this does not user locale setting and should therefore not be used for user-facing date
|
|
6
|
+
* formatting. Prefer using `toLocaleString` instead for user-facing strings.
|
|
7
|
+
*
|
|
8
|
+
* Example output: `'2023-12-05'`
|
|
9
|
+
*/
|
|
10
|
+
export function toSimpleDatePartString(fullDate) {
|
|
11
|
+
const dateParts = [
|
|
12
|
+
String(Math.abs(fullDate.year)).padStart(4, '0'),
|
|
13
|
+
String(Math.abs(fullDate.month)).padStart(2, '0'),
|
|
14
|
+
String(Math.abs(fullDate.day)).padStart(2, '0'),
|
|
15
|
+
];
|
|
16
|
+
const dateString = dateParts.join('-');
|
|
17
|
+
return dateString;
|
|
18
|
+
}
|
|
19
|
+
export function toSimpleTimePartString(fullDate, includeSeconds) {
|
|
20
|
+
const seconds = typedHasProperty(fullDate, 'second') && includeSeconds
|
|
21
|
+
? String(Math.abs(fullDate.second)).padStart(2, '0')
|
|
22
|
+
: undefined;
|
|
23
|
+
const timeParts = [
|
|
24
|
+
String(Math.abs(fullDate.hour)).padStart(2, '0'),
|
|
25
|
+
String(Math.abs(fullDate.minute)).padStart(2, '0'),
|
|
26
|
+
seconds,
|
|
27
|
+
].filter(isTruthy);
|
|
28
|
+
return timeParts.join(':');
|
|
29
|
+
}
|
|
30
|
+
export function toSimplePartStrings(fullDate, options) {
|
|
31
|
+
return {
|
|
32
|
+
date: toSimpleDatePartString(fullDate),
|
|
33
|
+
time: toSimpleTimePartString(fullDate, options.includeSeconds),
|
|
34
|
+
timezone: fullDate.timezone,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Converts a date into a simple, unambiguous date string.
|
|
39
|
+
*
|
|
40
|
+
* CAUTION: this does not user locale setting and should therefore not be used for user-facing date
|
|
41
|
+
* formatting. Prefer using `toLocaleString` instead for user-facing strings.
|
|
42
|
+
*/
|
|
43
|
+
export function toSimpleString(fullDate, options) {
|
|
44
|
+
const parts = toSimplePartStrings(fullDate, options);
|
|
45
|
+
const stringParts = [
|
|
46
|
+
parts.date,
|
|
47
|
+
parts.time,
|
|
48
|
+
options.includeTimezone && `(${parts.timezone})`,
|
|
49
|
+
].filter(isTruthy);
|
|
50
|
+
return stringParts.join(' ');
|
|
51
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FullDate } from '../full-date/full-date-shape';
|
|
2
|
+
import { UtcIsoString } from './string-format-types';
|
|
3
|
+
/** Convert a FullDate into a unix timestamp with milliseconds. */
|
|
4
|
+
export declare function toTimestamp(fullDate: FullDate): number;
|
|
5
|
+
/** Convert a FullDate into an ISO string in UTC; always ends in Z. */
|
|
6
|
+
export declare function toIsoString(fullDate: FullDate): UtcIsoString;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { toLuxonDateTime } from '../full-date/luxon-date-time-conversion';
|
|
2
|
+
import { utcTimezone } from '../timezone/timezones';
|
|
3
|
+
/** Convert a FullDate into a unix timestamp with milliseconds. */
|
|
4
|
+
export function toTimestamp(fullDate) {
|
|
5
|
+
return toLuxonDateTime(fullDate).toMillis();
|
|
6
|
+
}
|
|
7
|
+
/** Convert a FullDate into an ISO string in UTC; always ends in Z. */
|
|
8
|
+
export function toIsoString(fullDate) {
|
|
9
|
+
const isoString = toLuxonDateTime(fullDate).setZone(utcTimezone).toISO();
|
|
10
|
+
/** Ignore this edge case in the types and idk how to trigger it. */
|
|
11
|
+
/* c8 ignore next 3 */
|
|
12
|
+
if (!isoString) {
|
|
13
|
+
throw new Error(`Unable to get ISO string for '${JSON.stringify(fullDate)}'`);
|
|
14
|
+
}
|
|
15
|
+
return isoString;
|
|
16
|
+
}
|
|
@@ -24,7 +24,7 @@ export declare const timePartShape: import("object-shape-tester").ShapeDefinitio
|
|
|
24
24
|
millisecond: number;
|
|
25
25
|
/** The timezone that this date/time is meant for / originated from. */
|
|
26
26
|
timezone: "Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Coral_Harbour" | "America/Costa_Rica" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Nelson" | "America/Fortaleza" | "America/Glace_Bay" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Nuuk" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Sitka" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qostanay" | "Asia/Qyzylorda" | "Asia/Riyadh" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "CET" | "CST6CDT" | "EET" | "EST" | "EST5EDT" | "Etc/GMT+1" | "Etc/GMT+10" | "Etc/GMT+11" | "Etc/GMT+12" | "Etc/GMT+2" | "Etc/GMT+3" | "Etc/GMT+4" | "Etc/GMT+5" | "Etc/GMT+6" | "Etc/GMT+7" | "Etc/GMT+8" | "Etc/GMT+9" | "Etc/GMT-1" | "Etc/GMT-10" | "Etc/GMT-11" | "Etc/GMT-12" | "Etc/GMT-13" | "Etc/GMT-14" | "Etc/GMT-2" | "Etc/GMT-3" | "Etc/GMT-4" | "Etc/GMT-5" | "Etc/GMT-6" | "Etc/GMT-7" | "Etc/GMT-8" | "Etc/GMT-9" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kirov" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Factory" | "HST" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "MET" | "MST" | "MST7MDT" | "PST8PDT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kanton" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Wake" | "Pacific/Wallis" | "UTC" | "WET";
|
|
27
|
-
}>;
|
|
27
|
+
}, false>;
|
|
28
28
|
export type TimePart<SpecificTimezone extends Timezone = Timezone> = RequiredBy<Partial<FullDate<SpecificTimezone>>, keyof (typeof timePartShape)['runTimeType']>;
|
|
29
29
|
export declare const datePartShape: import("object-shape-tester").ShapeDefinition<{
|
|
30
30
|
/**
|
|
@@ -40,7 +40,7 @@ export declare const datePartShape: import("object-shape-tester").ShapeDefinitio
|
|
|
40
40
|
day: number;
|
|
41
41
|
/** The timezone that this date/time is meant for / originated from. */
|
|
42
42
|
timezone: "Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Coral_Harbour" | "America/Costa_Rica" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Nelson" | "America/Fortaleza" | "America/Glace_Bay" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Nuuk" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Sitka" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qostanay" | "Asia/Qyzylorda" | "Asia/Riyadh" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "CET" | "CST6CDT" | "EET" | "EST" | "EST5EDT" | "Etc/GMT+1" | "Etc/GMT+10" | "Etc/GMT+11" | "Etc/GMT+12" | "Etc/GMT+2" | "Etc/GMT+3" | "Etc/GMT+4" | "Etc/GMT+5" | "Etc/GMT+6" | "Etc/GMT+7" | "Etc/GMT+8" | "Etc/GMT+9" | "Etc/GMT-1" | "Etc/GMT-10" | "Etc/GMT-11" | "Etc/GMT-12" | "Etc/GMT-13" | "Etc/GMT-14" | "Etc/GMT-2" | "Etc/GMT-3" | "Etc/GMT-4" | "Etc/GMT-5" | "Etc/GMT-6" | "Etc/GMT-7" | "Etc/GMT-8" | "Etc/GMT-9" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kirov" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Factory" | "HST" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "MET" | "MST" | "MST7MDT" | "PST8PDT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kanton" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Wake" | "Pacific/Wallis" | "UTC" | "WET";
|
|
43
|
-
}>;
|
|
43
|
+
}, false>;
|
|
44
44
|
export type DatePart<SpecificTimezone extends Timezone = Timezone> = RequiredBy<Partial<FullDate<SpecificTimezone>>, keyof (typeof datePartShape)['runTimeType']>;
|
|
45
45
|
export declare const fullDateShape: import("object-shape-tester").ShapeDefinition<import("object-shape-tester").ShapeAnd<[import("object-shape-tester").ShapeDefinition<{
|
|
46
46
|
/**
|
|
@@ -56,7 +56,7 @@ export declare const fullDateShape: import("object-shape-tester").ShapeDefinitio
|
|
|
56
56
|
day: number;
|
|
57
57
|
/** The timezone that this date/time is meant for / originated from. */
|
|
58
58
|
timezone: "Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Coral_Harbour" | "America/Costa_Rica" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Nelson" | "America/Fortaleza" | "America/Glace_Bay" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Nuuk" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Sitka" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qostanay" | "Asia/Qyzylorda" | "Asia/Riyadh" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "CET" | "CST6CDT" | "EET" | "EST" | "EST5EDT" | "Etc/GMT+1" | "Etc/GMT+10" | "Etc/GMT+11" | "Etc/GMT+12" | "Etc/GMT+2" | "Etc/GMT+3" | "Etc/GMT+4" | "Etc/GMT+5" | "Etc/GMT+6" | "Etc/GMT+7" | "Etc/GMT+8" | "Etc/GMT+9" | "Etc/GMT-1" | "Etc/GMT-10" | "Etc/GMT-11" | "Etc/GMT-12" | "Etc/GMT-13" | "Etc/GMT-14" | "Etc/GMT-2" | "Etc/GMT-3" | "Etc/GMT-4" | "Etc/GMT-5" | "Etc/GMT-6" | "Etc/GMT-7" | "Etc/GMT-8" | "Etc/GMT-9" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kirov" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Factory" | "HST" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "MET" | "MST" | "MST7MDT" | "PST8PDT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kanton" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Wake" | "Pacific/Wallis" | "UTC" | "WET";
|
|
59
|
-
}>, import("object-shape-tester").ShapeDefinition<{
|
|
59
|
+
}, false>, import("object-shape-tester").ShapeDefinition<{
|
|
60
60
|
/** Hour of the day in 24 time: 0-23 */
|
|
61
61
|
hour: number;
|
|
62
62
|
/** Minute of the hour: 0-59 */
|
|
@@ -67,7 +67,7 @@ export declare const fullDateShape: import("object-shape-tester").ShapeDefinitio
|
|
|
67
67
|
millisecond: number;
|
|
68
68
|
/** The timezone that this date/time is meant for / originated from. */
|
|
69
69
|
timezone: "Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Coral_Harbour" | "America/Costa_Rica" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Nelson" | "America/Fortaleza" | "America/Glace_Bay" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Nuuk" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Sitka" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qostanay" | "Asia/Qyzylorda" | "Asia/Riyadh" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "CET" | "CST6CDT" | "EET" | "EST" | "EST5EDT" | "Etc/GMT+1" | "Etc/GMT+10" | "Etc/GMT+11" | "Etc/GMT+12" | "Etc/GMT+2" | "Etc/GMT+3" | "Etc/GMT+4" | "Etc/GMT+5" | "Etc/GMT+6" | "Etc/GMT+7" | "Etc/GMT+8" | "Etc/GMT+9" | "Etc/GMT-1" | "Etc/GMT-10" | "Etc/GMT-11" | "Etc/GMT-12" | "Etc/GMT-13" | "Etc/GMT-14" | "Etc/GMT-2" | "Etc/GMT-3" | "Etc/GMT-4" | "Etc/GMT-5" | "Etc/GMT-6" | "Etc/GMT-7" | "Etc/GMT-8" | "Etc/GMT-9" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kirov" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Factory" | "HST" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "MET" | "MST" | "MST7MDT" | "PST8PDT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kanton" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Wake" | "Pacific/Wallis" | "UTC" | "WET";
|
|
70
|
-
}>]
|
|
70
|
+
}, false>]>, false>;
|
|
71
71
|
/**
|
|
72
72
|
* A easily serializable (it fits into plain JSON) object that completely defines how a date is to
|
|
73
73
|
* be represented with minimal data.
|