@internationalized/date 3.12.0 → 3.12.2
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/index.cjs +113 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/private/CalendarDate.cjs +272 -0
- package/dist/private/CalendarDate.cjs.map +1 -0
- package/dist/private/CalendarDate.js +282 -0
- package/dist/private/CalendarDate.js.map +1 -0
- package/dist/private/CalendarDate.mjs +264 -0
- package/dist/private/CalendarDate.mjs.map +1 -0
- package/dist/{DateFormatter.main.js → private/DateFormatter.cjs} +31 -28
- package/dist/private/DateFormatter.cjs.map +1 -0
- package/dist/{DateFormatter.module.js → private/DateFormatter.js} +27 -24
- package/dist/private/DateFormatter.js.map +1 -0
- package/dist/{DateFormatter.mjs → private/DateFormatter.mjs} +31 -28
- package/dist/private/DateFormatter.mjs.map +1 -0
- package/dist/{BuddhistCalendar.main.js → private/calendars/BuddhistCalendar.cjs} +13 -13
- package/dist/{BuddhistCalendar.main.js.map → private/calendars/BuddhistCalendar.cjs.map} +1 -1
- package/dist/{BuddhistCalendar.module.js → private/calendars/BuddhistCalendar.js} +13 -13
- package/dist/{BuddhistCalendar.module.js.map → private/calendars/BuddhistCalendar.js.map} +1 -1
- package/dist/{BuddhistCalendar.mjs → private/calendars/BuddhistCalendar.mjs} +13 -13
- package/dist/private/calendars/BuddhistCalendar.mjs.map +1 -0
- package/dist/{EthiopicCalendar.main.js → private/calendars/EthiopicCalendar.cjs} +37 -37
- package/dist/private/calendars/EthiopicCalendar.cjs.map +1 -0
- package/dist/{EthiopicCalendar.module.js → private/calendars/EthiopicCalendar.js} +35 -35
- package/dist/private/calendars/EthiopicCalendar.js.map +1 -0
- package/dist/{EthiopicCalendar.mjs → private/calendars/EthiopicCalendar.mjs} +35 -35
- package/dist/private/calendars/EthiopicCalendar.mjs.map +1 -0
- package/dist/{GregorianCalendar.main.js → private/calendars/GregorianCalendar.cjs} +31 -31
- package/dist/private/calendars/GregorianCalendar.cjs.map +1 -0
- package/dist/{GregorianCalendar.module.js → private/calendars/GregorianCalendar.js} +27 -27
- package/dist/private/calendars/GregorianCalendar.js.map +1 -0
- package/dist/{GregorianCalendar.mjs → private/calendars/GregorianCalendar.mjs} +27 -27
- package/dist/private/calendars/GregorianCalendar.mjs.map +1 -0
- package/dist/{HebrewCalendar.main.js → private/calendars/HebrewCalendar.cjs} +44 -44
- package/dist/private/calendars/HebrewCalendar.cjs.map +1 -0
- package/dist/{HebrewCalendar.module.js → private/calendars/HebrewCalendar.js} +44 -44
- package/dist/private/calendars/HebrewCalendar.js.map +1 -0
- package/dist/{HebrewCalendar.mjs → private/calendars/HebrewCalendar.mjs} +44 -44
- package/dist/private/calendars/HebrewCalendar.mjs.map +1 -0
- package/dist/{IndianCalendar.main.js → private/calendars/IndianCalendar.cjs} +20 -20
- package/dist/private/calendars/IndianCalendar.cjs.map +1 -0
- package/dist/{IndianCalendar.module.js → private/calendars/IndianCalendar.js} +20 -20
- package/dist/private/calendars/IndianCalendar.js.map +1 -0
- package/dist/{IndianCalendar.mjs → private/calendars/IndianCalendar.mjs} +20 -20
- package/dist/private/calendars/IndianCalendar.mjs.map +1 -0
- package/dist/private/calendars/IslamicCalendar.cjs +168 -0
- package/dist/private/calendars/IslamicCalendar.cjs.map +1 -0
- package/dist/private/calendars/IslamicCalendar.js +161 -0
- package/dist/private/calendars/IslamicCalendar.js.map +1 -0
- package/dist/private/calendars/IslamicCalendar.mjs +161 -0
- package/dist/private/calendars/IslamicCalendar.mjs.map +1 -0
- package/dist/{JapaneseCalendar.main.js → private/calendars/JapaneseCalendar.cjs} +37 -37
- package/dist/private/calendars/JapaneseCalendar.cjs.map +1 -0
- package/dist/{JapaneseCalendar.module.js → private/calendars/JapaneseCalendar.js} +37 -37
- package/dist/private/calendars/JapaneseCalendar.js.map +1 -0
- package/dist/{JapaneseCalendar.mjs → private/calendars/JapaneseCalendar.mjs} +37 -37
- package/dist/private/calendars/JapaneseCalendar.mjs.map +1 -0
- package/dist/{PersianCalendar.main.js → private/calendars/PersianCalendar.cjs} +13 -13
- package/dist/private/calendars/PersianCalendar.cjs.map +1 -0
- package/dist/{PersianCalendar.module.js → private/calendars/PersianCalendar.js} +13 -13
- package/dist/private/calendars/PersianCalendar.js.map +1 -0
- package/dist/{PersianCalendar.mjs → private/calendars/PersianCalendar.mjs} +13 -13
- package/dist/private/calendars/PersianCalendar.mjs.map +1 -0
- package/dist/{TaiwanCalendar.main.js → private/calendars/TaiwanCalendar.cjs} +20 -20
- package/dist/{TaiwanCalendar.main.js.map → private/calendars/TaiwanCalendar.cjs.map} +1 -1
- package/dist/private/calendars/TaiwanCalendar.js +75 -0
- package/dist/{TaiwanCalendar.module.js.map → private/calendars/TaiwanCalendar.js.map} +1 -1
- package/dist/{TaiwanCalendar.mjs → private/calendars/TaiwanCalendar.mjs} +20 -20
- package/dist/private/calendars/TaiwanCalendar.mjs.map +1 -0
- package/dist/{conversion.main.js → private/conversion.cjs} +85 -85
- package/dist/private/conversion.cjs.map +1 -0
- package/dist/{conversion.module.js → private/conversion.js} +71 -71
- package/dist/private/conversion.js.map +1 -0
- package/dist/{conversion.mjs → private/conversion.mjs} +71 -71
- package/dist/private/conversion.mjs.map +1 -0
- package/dist/private/createCalendar.cjs +69 -0
- package/dist/private/createCalendar.cjs.map +1 -0
- package/dist/private/createCalendar.js +64 -0
- package/dist/private/createCalendar.js.map +1 -0
- package/dist/private/createCalendar.mjs +64 -0
- package/dist/private/createCalendar.mjs.map +1 -0
- package/dist/{manipulation.main.js → private/manipulation.cjs} +106 -109
- package/dist/private/manipulation.cjs.map +1 -0
- package/dist/{manipulation.mjs → private/manipulation.js} +88 -88
- package/dist/private/manipulation.js.map +1 -0
- package/dist/{manipulation.module.js → private/manipulation.mjs} +93 -96
- package/dist/private/manipulation.mjs.map +1 -0
- package/dist/private/queries.cjs +359 -0
- package/dist/private/queries.cjs.map +1 -0
- package/dist/private/queries.js +326 -0
- package/dist/private/queries.js.map +1 -0
- package/dist/private/queries.mjs +324 -0
- package/dist/private/queries.mjs.map +1 -0
- package/dist/private/string.cjs +181 -0
- package/dist/private/string.cjs.map +1 -0
- package/dist/{string.mjs → private/string.js} +64 -64
- package/dist/private/string.js.map +1 -0
- package/dist/private/string.mjs +166 -0
- package/dist/private/string.mjs.map +1 -0
- package/dist/{utils.main.js → private/utils.cjs} +3 -3
- package/dist/{utils.main.js.map → private/utils.cjs.map} +1 -1
- package/dist/{utils.module.js → private/utils.js} +3 -3
- package/dist/{utils.module.js.map → private/utils.js.map} +1 -1
- package/dist/{utils.mjs → private/utils.mjs} +3 -3
- package/dist/private/utils.mjs.map +1 -0
- package/dist/{weekStartData.main.js → private/weekStartData.cjs} +3 -3
- package/dist/{weekStartData.main.js.map → private/weekStartData.cjs.map} +1 -1
- package/dist/{weekStartData.module.js → private/weekStartData.js} +3 -3
- package/dist/{weekStartData.module.js.map → private/weekStartData.js.map} +1 -1
- package/dist/{weekStartData.mjs → private/weekStartData.mjs} +3 -3
- package/dist/private/weekStartData.mjs.map +1 -0
- package/dist/types/src/CalendarDate.d.ts +207 -0
- package/dist/types/src/DateFormatter.d.ts +24 -0
- package/dist/types/src/calendars/BuddhistCalendar.d.ts +16 -0
- package/dist/types/src/calendars/EthiopicCalendar.d.ts +45 -0
- package/dist/types/src/calendars/GregorianCalendar.d.ts +26 -0
- package/dist/types/src/calendars/HebrewCalendar.d.ts +21 -0
- package/dist/types/src/calendars/IndianCalendar.d.ts +17 -0
- package/dist/types/src/calendars/IslamicCalendar.d.ts +51 -0
- package/dist/types/src/calendars/JapaneseCalendar.d.ts +22 -0
- package/dist/types/src/calendars/PersianCalendar.d.ts +19 -0
- package/dist/types/src/calendars/TaiwanCalendar.d.ts +19 -0
- package/dist/types/src/conversion.d.ts +45 -0
- package/dist/types/src/createCalendar.d.ts +3 -0
- package/dist/types/src/index.d.ts +17 -0
- package/dist/types/src/manipulation.d.ts +25 -0
- package/dist/types/src/queries.d.ts +93 -0
- package/dist/types/src/string.d.ts +36 -0
- package/dist/types/src/types.d.ts +136 -0
- package/dist/types/src/utils.d.ts +4 -0
- package/dist/types/src/weekStartData.d.ts +97 -0
- package/package.json +33 -18
- package/src/CalendarDate.ts +215 -35
- package/src/DateFormatter.ts +36 -16
- package/src/calendars/BuddhistCalendar.ts +1 -6
- package/src/calendars/EthiopicCalendar.ts +6 -5
- package/src/calendars/GregorianCalendar.ts +11 -4
- package/src/calendars/HebrewCalendar.ts +8 -4
- package/src/calendars/IndianCalendar.ts +8 -3
- package/src/calendars/IslamicCalendar.ts +40 -25
- package/src/calendars/JapaneseCalendar.ts +18 -10
- package/src/calendars/PersianCalendar.ts +2 -4
- package/src/calendars/TaiwanCalendar.ts +2 -9
- package/src/conversion.ts +98 -25
- package/src/createCalendar.ts +10 -2
- package/src/index.ts +11 -2
- package/src/manipulation.ts +133 -30
- package/src/queries.ts +57 -15
- package/src/string.ts +52 -25
- package/src/types.ts +73 -51
- package/src/utils.ts +1 -1
- package/dist/CalendarDate.main.js +0 -260
- package/dist/CalendarDate.main.js.map +0 -1
- package/dist/CalendarDate.mjs +0 -252
- package/dist/CalendarDate.module.js +0 -252
- package/dist/CalendarDate.module.js.map +0 -1
- package/dist/DateFormatter.main.js.map +0 -1
- package/dist/DateFormatter.module.js.map +0 -1
- package/dist/EthiopicCalendar.main.js.map +0 -1
- package/dist/EthiopicCalendar.module.js.map +0 -1
- package/dist/GregorianCalendar.main.js.map +0 -1
- package/dist/GregorianCalendar.module.js.map +0 -1
- package/dist/HebrewCalendar.main.js.map +0 -1
- package/dist/HebrewCalendar.module.js.map +0 -1
- package/dist/IndianCalendar.main.js.map +0 -1
- package/dist/IndianCalendar.module.js.map +0 -1
- package/dist/IslamicCalendar.main.js +0 -168
- package/dist/IslamicCalendar.main.js.map +0 -1
- package/dist/IslamicCalendar.mjs +0 -161
- package/dist/IslamicCalendar.module.js +0 -161
- package/dist/IslamicCalendar.module.js.map +0 -1
- package/dist/JapaneseCalendar.main.js.map +0 -1
- package/dist/JapaneseCalendar.module.js.map +0 -1
- package/dist/PersianCalendar.main.js.map +0 -1
- package/dist/PersianCalendar.module.js.map +0 -1
- package/dist/TaiwanCalendar.module.js +0 -75
- package/dist/conversion.main.js.map +0 -1
- package/dist/conversion.module.js.map +0 -1
- package/dist/createCalendar.main.js +0 -69
- package/dist/createCalendar.main.js.map +0 -1
- package/dist/createCalendar.mjs +0 -64
- package/dist/createCalendar.module.js +0 -64
- package/dist/createCalendar.module.js.map +0 -1
- package/dist/import.mjs +0 -45
- package/dist/main.js +0 -113
- package/dist/main.js.map +0 -1
- package/dist/manipulation.main.js.map +0 -1
- package/dist/manipulation.module.js.map +0 -1
- package/dist/module.js +0 -45
- package/dist/module.js.map +0 -1
- package/dist/queries.main.js +0 -361
- package/dist/queries.main.js.map +0 -1
- package/dist/queries.mjs +0 -326
- package/dist/queries.module.js +0 -326
- package/dist/queries.module.js.map +0 -1
- package/dist/string.main.js +0 -190
- package/dist/string.main.js.map +0 -1
- package/dist/string.module.js +0 -175
- package/dist/string.module.js.map +0 -1
- package/dist/types.d.ts +0 -672
- package/dist/types.d.ts.map +0 -1
package/src/types.ts
CHANGED
|
@@ -14,27 +14,45 @@ import {CalendarDate} from './CalendarDate';
|
|
|
14
14
|
|
|
15
15
|
/** An interface that is compatible with any object with date fields. */
|
|
16
16
|
export interface AnyCalendarDate {
|
|
17
|
-
readonly calendar: Calendar
|
|
18
|
-
readonly era: string
|
|
19
|
-
readonly year: number
|
|
20
|
-
readonly month: number
|
|
21
|
-
readonly day: number
|
|
22
|
-
copy(): this
|
|
17
|
+
readonly calendar: Calendar;
|
|
18
|
+
readonly era: string;
|
|
19
|
+
readonly year: number;
|
|
20
|
+
readonly month: number;
|
|
21
|
+
readonly day: number;
|
|
22
|
+
copy(): this;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** An interface that is compatible with any object with time fields. */
|
|
26
26
|
export interface AnyTime {
|
|
27
|
-
readonly hour: number
|
|
28
|
-
readonly minute: number
|
|
29
|
-
readonly second: number
|
|
30
|
-
readonly millisecond: number
|
|
31
|
-
copy(): this
|
|
27
|
+
readonly hour: number;
|
|
28
|
+
readonly minute: number;
|
|
29
|
+
readonly second: number;
|
|
30
|
+
readonly millisecond: number;
|
|
31
|
+
copy(): this;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** An interface that is compatible with any object with both date and time fields. */
|
|
35
35
|
export interface AnyDateTime extends AnyCalendarDate, AnyTime {}
|
|
36
36
|
|
|
37
|
-
export type CalendarIdentifier =
|
|
37
|
+
export type CalendarIdentifier =
|
|
38
|
+
| 'gregory'
|
|
39
|
+
| 'buddhist'
|
|
40
|
+
| 'chinese'
|
|
41
|
+
| 'coptic'
|
|
42
|
+
| 'dangi'
|
|
43
|
+
| 'ethioaa'
|
|
44
|
+
| 'ethiopic'
|
|
45
|
+
| 'hebrew'
|
|
46
|
+
| 'indian'
|
|
47
|
+
| 'islamic'
|
|
48
|
+
| 'islamic-umalqura'
|
|
49
|
+
| 'islamic-tbla'
|
|
50
|
+
| 'islamic-civil'
|
|
51
|
+
| 'islamic-rgsa'
|
|
52
|
+
| 'iso8601'
|
|
53
|
+
| 'japanese'
|
|
54
|
+
| 'persian'
|
|
55
|
+
| 'roc';
|
|
38
56
|
|
|
39
57
|
/**
|
|
40
58
|
* The Calendar interface represents a calendar system, including information
|
|
@@ -43,101 +61,104 @@ export type CalendarIdentifier = 'gregory' | 'buddhist' | 'chinese' | 'coptic' |
|
|
|
43
61
|
*/
|
|
44
62
|
export interface Calendar {
|
|
45
63
|
/**
|
|
46
|
-
* A string identifier for the calendar, as defined by Unicode CLDR.
|
|
47
|
-
*
|
|
64
|
+
* A string identifier for the calendar, as defined by Unicode CLDR. See
|
|
65
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#supported_calendar_types).
|
|
48
66
|
*/
|
|
49
|
-
identifier: CalendarIdentifier
|
|
67
|
+
identifier: CalendarIdentifier;
|
|
50
68
|
|
|
51
69
|
/** Creates a CalendarDate in this calendar from the given Julian day number. */
|
|
52
|
-
fromJulianDay(jd: number): CalendarDate
|
|
70
|
+
fromJulianDay(jd: number): CalendarDate;
|
|
53
71
|
/** Converts a date in this calendar to a Julian day number. */
|
|
54
|
-
toJulianDay(date: AnyCalendarDate): number
|
|
72
|
+
toJulianDay(date: AnyCalendarDate): number;
|
|
55
73
|
|
|
56
74
|
/** Returns the number of days in the month of the given date. */
|
|
57
|
-
getDaysInMonth(date: AnyCalendarDate): number
|
|
75
|
+
getDaysInMonth(date: AnyCalendarDate): number;
|
|
58
76
|
/** Returns the number of months in the year of the given date. */
|
|
59
|
-
getMonthsInYear(date: AnyCalendarDate): number
|
|
77
|
+
getMonthsInYear(date: AnyCalendarDate): number;
|
|
60
78
|
/** Returns the number of years in the era of the given date. */
|
|
61
|
-
getYearsInEra(date: AnyCalendarDate): number
|
|
79
|
+
getYearsInEra(date: AnyCalendarDate): number;
|
|
62
80
|
/** Returns a list of era identifiers for the calendar. */
|
|
63
|
-
getEras(): string[]
|
|
81
|
+
getEras(): string[];
|
|
64
82
|
|
|
65
83
|
/**
|
|
66
84
|
* Returns the minimum month number of the given date's year.
|
|
67
85
|
* Normally, this is 1, but in some calendars such as the Japanese,
|
|
68
86
|
* eras may begin in the middle of a year.
|
|
69
87
|
*/
|
|
70
|
-
getMinimumMonthInYear?(date: AnyCalendarDate): number
|
|
88
|
+
getMinimumMonthInYear?(date: AnyCalendarDate): number;
|
|
71
89
|
/**
|
|
72
90
|
* Returns the minimum day number of the given date's month.
|
|
73
91
|
* Normally, this is 1, but in some calendars such as the Japanese,
|
|
74
92
|
* eras may begin in the middle of a month.
|
|
75
93
|
*/
|
|
76
|
-
getMinimumDayInMonth?(date: AnyCalendarDate): number
|
|
94
|
+
getMinimumDayInMonth?(date: AnyCalendarDate): number;
|
|
77
95
|
/** Returns the maximum months across all years. */
|
|
78
|
-
getMaximumMonthsInYear(): number
|
|
96
|
+
getMaximumMonthsInYear(): number;
|
|
79
97
|
/** Returns the maximum days across all months. */
|
|
80
|
-
getMaximumDaysInMonth(): number
|
|
98
|
+
getMaximumDaysInMonth(): number;
|
|
81
99
|
/**
|
|
82
100
|
* Returns a date that is the first day of the month for the given date.
|
|
83
101
|
* This is used to determine the month that the given date falls in, if
|
|
84
|
-
* the calendar has months that do not align with the standard calendar months
|
|
102
|
+
* the calendar has months that do not align with the standard calendar months
|
|
85
103
|
* (e.g. fiscal calendars).
|
|
86
104
|
*/
|
|
87
|
-
getFormattableMonth?(date: AnyCalendarDate): CalendarDate
|
|
105
|
+
getFormattableMonth?(date: AnyCalendarDate): CalendarDate;
|
|
88
106
|
|
|
89
107
|
/** Returns whether the given calendar is the same as this calendar. */
|
|
90
|
-
isEqual?(calendar: Calendar): boolean
|
|
108
|
+
isEqual?(calendar: Calendar): boolean;
|
|
91
109
|
|
|
92
110
|
/** @private */
|
|
93
|
-
balanceDate?(date: AnyCalendarDate): void
|
|
111
|
+
balanceDate?(date: AnyCalendarDate): void;
|
|
94
112
|
/** @private */
|
|
95
|
-
balanceYearMonth?(date: AnyCalendarDate, previousDate: AnyCalendarDate): void
|
|
113
|
+
balanceYearMonth?(date: AnyCalendarDate, previousDate: AnyCalendarDate): void;
|
|
96
114
|
/** @private */
|
|
97
|
-
constrainDate?(date: AnyCalendarDate): void
|
|
115
|
+
constrainDate?(date: AnyCalendarDate): void;
|
|
98
116
|
/** @private */
|
|
99
|
-
isInverseEra?(date: AnyCalendarDate): boolean
|
|
117
|
+
isInverseEra?(date: AnyCalendarDate): boolean;
|
|
100
118
|
}
|
|
101
119
|
|
|
102
120
|
/** Represents an amount of time in calendar-specific units, for use when performing arithmetic. */
|
|
103
121
|
export interface DateDuration {
|
|
104
122
|
/** The number of years to add or subtract. */
|
|
105
|
-
years?: number
|
|
123
|
+
years?: number;
|
|
106
124
|
/** The number of months to add or subtract. */
|
|
107
|
-
months?: number
|
|
125
|
+
months?: number;
|
|
108
126
|
/** The number of weeks to add or subtract. */
|
|
109
|
-
weeks?: number
|
|
127
|
+
weeks?: number;
|
|
110
128
|
/** The number of days to add or subtract. */
|
|
111
|
-
days?: number
|
|
129
|
+
days?: number;
|
|
112
130
|
}
|
|
113
131
|
|
|
114
132
|
/** Represents an amount of time, for use whe performing arithmetic. */
|
|
115
133
|
export interface TimeDuration {
|
|
116
134
|
/** The number of hours to add or subtract. */
|
|
117
|
-
hours?: number
|
|
135
|
+
hours?: number;
|
|
118
136
|
/** The number of minutes to add or subtract. */
|
|
119
|
-
minutes?: number
|
|
137
|
+
minutes?: number;
|
|
120
138
|
/** The number of seconds to add or subtract. */
|
|
121
|
-
seconds?: number
|
|
139
|
+
seconds?: number;
|
|
122
140
|
/** The number of milliseconds to add or subtract. */
|
|
123
|
-
milliseconds?: number
|
|
141
|
+
milliseconds?: number;
|
|
124
142
|
}
|
|
125
143
|
|
|
126
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Represents an amount of time with both date and time components, for use when performing
|
|
146
|
+
* arithmetic.
|
|
147
|
+
*/
|
|
127
148
|
export interface DateTimeDuration extends DateDuration, TimeDuration {}
|
|
128
149
|
|
|
129
150
|
export interface DateFields {
|
|
130
|
-
era?: string
|
|
131
|
-
year?: number
|
|
132
|
-
month?: number
|
|
133
|
-
day?: number
|
|
151
|
+
era?: string;
|
|
152
|
+
year?: number;
|
|
153
|
+
month?: number;
|
|
154
|
+
day?: number;
|
|
134
155
|
}
|
|
135
156
|
|
|
136
157
|
export interface TimeFields {
|
|
137
|
-
hour?: number
|
|
138
|
-
minute?: number
|
|
139
|
-
second?: number
|
|
140
|
-
millisecond?: number
|
|
158
|
+
hour?: number;
|
|
159
|
+
minute?: number;
|
|
160
|
+
second?: number;
|
|
161
|
+
millisecond?: number;
|
|
141
162
|
}
|
|
142
163
|
|
|
143
164
|
export type DateField = keyof DateFields;
|
|
@@ -147,7 +168,7 @@ export type Disambiguation = 'compatible' | 'earlier' | 'later' | 'reject';
|
|
|
147
168
|
|
|
148
169
|
export interface CycleOptions {
|
|
149
170
|
/** Whether to round the field value to the nearest interval of the amount. */
|
|
150
|
-
round?: boolean
|
|
171
|
+
round?: boolean;
|
|
151
172
|
}
|
|
152
173
|
|
|
153
174
|
export interface CycleTimeOptions extends CycleOptions {
|
|
@@ -155,7 +176,8 @@ export interface CycleTimeOptions extends CycleOptions {
|
|
|
155
176
|
* Whether to use 12 or 24 hour time. If 12 hour time is chosen, the resulting value
|
|
156
177
|
* will remain in the same day period as the original value (e.g. if the value is AM,
|
|
157
178
|
* the resulting value also be AM).
|
|
179
|
+
*
|
|
158
180
|
* @default 24
|
|
159
181
|
*/
|
|
160
|
-
hourCycle?: 12 | 24
|
|
182
|
+
hourCycle?: 12 | 24;
|
|
161
183
|
}
|
package/src/utils.ts
CHANGED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
var $5c0571aa5b6fb5da$exports = require("./manipulation.main.js");
|
|
2
|
-
var $1f0f7ebf1ae6c530$exports = require("./queries.main.js");
|
|
3
|
-
var $4c32e2d98e5a5134$exports = require("./string.main.js");
|
|
4
|
-
var $af14c9812fdceb33$exports = require("./GregorianCalendar.main.js");
|
|
5
|
-
var $4ae0260a69729f1d$exports = require("./conversion.main.js");
|
|
6
|
-
var $lislG$swchelperscjs_class_private_field_initcjs = require("@swc/helpers/cjs/_class_private_field_init.cjs");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function $parcel$export(e, n, v, s) {
|
|
10
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
$parcel$export(module.exports, "CalendarDate", () => $625ad1e1f4c43bc1$export$99faa760c7908e4f);
|
|
14
|
-
$parcel$export(module.exports, "Time", () => $625ad1e1f4c43bc1$export$680ea196effce5f);
|
|
15
|
-
$parcel$export(module.exports, "CalendarDateTime", () => $625ad1e1f4c43bc1$export$ca871e8dbb80966f);
|
|
16
|
-
$parcel$export(module.exports, "ZonedDateTime", () => $625ad1e1f4c43bc1$export$d3b7288e7994edea);
|
|
17
|
-
/*
|
|
18
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
-
*
|
|
23
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
-
* governing permissions and limitations under the License.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function $625ad1e1f4c43bc1$var$shiftArgs(args) {
|
|
34
|
-
let calendar = typeof args[0] === 'object' ? args.shift() : new (0, $af14c9812fdceb33$exports.GregorianCalendar)();
|
|
35
|
-
let era;
|
|
36
|
-
if (typeof args[0] === 'string') era = args.shift();
|
|
37
|
-
else {
|
|
38
|
-
let eras = calendar.getEras();
|
|
39
|
-
era = eras[eras.length - 1];
|
|
40
|
-
}
|
|
41
|
-
let year = args.shift();
|
|
42
|
-
let month = args.shift();
|
|
43
|
-
let day = args.shift();
|
|
44
|
-
return [
|
|
45
|
-
calendar,
|
|
46
|
-
era,
|
|
47
|
-
year,
|
|
48
|
-
month,
|
|
49
|
-
day
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
53
|
-
// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
|
|
54
|
-
// If that behavior is desired, use the AnyCalendarDate interface instead.
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
$625ad1e1f4c43bc1$var$_type = /*#__PURE__*/ new WeakMap();
|
|
57
|
-
class $625ad1e1f4c43bc1$export$99faa760c7908e4f {
|
|
58
|
-
/** Returns a copy of this date. */ copy() {
|
|
59
|
-
if (this.era) return new $625ad1e1f4c43bc1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
|
|
60
|
-
else return new $625ad1e1f4c43bc1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
|
|
61
|
-
}
|
|
62
|
-
/** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
|
|
63
|
-
return (0, $5c0571aa5b6fb5da$exports.add)(this, duration);
|
|
64
|
-
}
|
|
65
|
-
/** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
|
|
66
|
-
return (0, $5c0571aa5b6fb5da$exports.subtract)(this, duration);
|
|
67
|
-
}
|
|
68
|
-
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
69
|
-
return (0, $5c0571aa5b6fb5da$exports.set)(this, fields);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
73
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
74
|
-
*/ cycle(field, amount, options) {
|
|
75
|
-
return (0, $5c0571aa5b6fb5da$exports.cycleDate)(this, field, amount, options);
|
|
76
|
-
}
|
|
77
|
-
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
|
|
78
|
-
return (0, $4ae0260a69729f1d$exports.toDate)(this, timeZone);
|
|
79
|
-
}
|
|
80
|
-
/** Converts the date to an ISO 8601 formatted string. */ toString() {
|
|
81
|
-
return (0, $4c32e2d98e5a5134$exports.dateToString)(this);
|
|
82
|
-
}
|
|
83
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
84
|
-
return (0, $1f0f7ebf1ae6c530$exports.compareDate)(this, b);
|
|
85
|
-
}
|
|
86
|
-
constructor(...args){
|
|
87
|
-
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type, {
|
|
88
|
-
writable: true,
|
|
89
|
-
value: void 0
|
|
90
|
-
});
|
|
91
|
-
let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
|
|
92
|
-
this.calendar = calendar;
|
|
93
|
-
this.era = era;
|
|
94
|
-
this.year = year;
|
|
95
|
-
this.month = month;
|
|
96
|
-
this.day = day;
|
|
97
|
-
(0, $5c0571aa5b6fb5da$exports.constrain)(this);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
$625ad1e1f4c43bc1$var$_type1 = /*#__PURE__*/ new WeakMap();
|
|
103
|
-
class $625ad1e1f4c43bc1$export$680ea196effce5f {
|
|
104
|
-
/** Returns a copy of this time. */ copy() {
|
|
105
|
-
return new $625ad1e1f4c43bc1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
|
|
106
|
-
}
|
|
107
|
-
/** Returns a new `Time` with the given duration added to it. */ add(duration) {
|
|
108
|
-
return (0, $5c0571aa5b6fb5da$exports.addTime)(this, duration);
|
|
109
|
-
}
|
|
110
|
-
/** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
|
|
111
|
-
return (0, $5c0571aa5b6fb5da$exports.subtractTime)(this, duration);
|
|
112
|
-
}
|
|
113
|
-
/** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
114
|
-
return (0, $5c0571aa5b6fb5da$exports.setTime)(this, fields);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Returns a new `Time` with the given field adjusted by a specified amount.
|
|
118
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
119
|
-
*/ cycle(field, amount, options) {
|
|
120
|
-
return (0, $5c0571aa5b6fb5da$exports.cycleTime)(this, field, amount, options);
|
|
121
|
-
}
|
|
122
|
-
/** Converts the time to an ISO 8601 formatted string. */ toString() {
|
|
123
|
-
return (0, $4c32e2d98e5a5134$exports.timeToString)(this);
|
|
124
|
-
}
|
|
125
|
-
/** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
|
|
126
|
-
return (0, $1f0f7ebf1ae6c530$exports.compareTime)(this, b);
|
|
127
|
-
}
|
|
128
|
-
constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
|
|
129
|
-
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type1, {
|
|
130
|
-
writable: true,
|
|
131
|
-
value: void 0
|
|
132
|
-
});
|
|
133
|
-
this.hour = hour;
|
|
134
|
-
this.minute = minute;
|
|
135
|
-
this.second = second;
|
|
136
|
-
this.millisecond = millisecond;
|
|
137
|
-
(0, $5c0571aa5b6fb5da$exports.constrainTime)(this);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
141
|
-
// @ts-ignore
|
|
142
|
-
$625ad1e1f4c43bc1$var$_type2 = /*#__PURE__*/ new WeakMap();
|
|
143
|
-
class $625ad1e1f4c43bc1$export$ca871e8dbb80966f {
|
|
144
|
-
/** Returns a copy of this date. */ copy() {
|
|
145
|
-
if (this.era) return new $625ad1e1f4c43bc1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
146
|
-
else return new $625ad1e1f4c43bc1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
147
|
-
}
|
|
148
|
-
/** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
|
|
149
|
-
return (0, $5c0571aa5b6fb5da$exports.add)(this, duration);
|
|
150
|
-
}
|
|
151
|
-
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
|
|
152
|
-
return (0, $5c0571aa5b6fb5da$exports.subtract)(this, duration);
|
|
153
|
-
}
|
|
154
|
-
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
155
|
-
return (0, $5c0571aa5b6fb5da$exports.set)((0, $5c0571aa5b6fb5da$exports.setTime)(this, fields), fields);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
159
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
160
|
-
*/ cycle(field, amount, options) {
|
|
161
|
-
switch(field){
|
|
162
|
-
case 'era':
|
|
163
|
-
case 'year':
|
|
164
|
-
case 'month':
|
|
165
|
-
case 'day':
|
|
166
|
-
return (0, $5c0571aa5b6fb5da$exports.cycleDate)(this, field, amount, options);
|
|
167
|
-
default:
|
|
168
|
-
return (0, $5c0571aa5b6fb5da$exports.cycleTime)(this, field, amount, options);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
|
|
172
|
-
return (0, $4ae0260a69729f1d$exports.toDate)(this, timeZone, disambiguation);
|
|
173
|
-
}
|
|
174
|
-
/** Converts the date to an ISO 8601 formatted string. */ toString() {
|
|
175
|
-
return (0, $4c32e2d98e5a5134$exports.dateTimeToString)(this);
|
|
176
|
-
}
|
|
177
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
178
|
-
let res = (0, $1f0f7ebf1ae6c530$exports.compareDate)(this, b);
|
|
179
|
-
if (res === 0) return (0, $1f0f7ebf1ae6c530$exports.compareTime)(this, (0, $4ae0260a69729f1d$exports.toCalendarDateTime)(b));
|
|
180
|
-
return res;
|
|
181
|
-
}
|
|
182
|
-
constructor(...args){
|
|
183
|
-
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type2, {
|
|
184
|
-
writable: true,
|
|
185
|
-
value: void 0
|
|
186
|
-
});
|
|
187
|
-
let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
|
|
188
|
-
this.calendar = calendar;
|
|
189
|
-
this.era = era;
|
|
190
|
-
this.year = year;
|
|
191
|
-
this.month = month;
|
|
192
|
-
this.day = day;
|
|
193
|
-
this.hour = args.shift() || 0;
|
|
194
|
-
this.minute = args.shift() || 0;
|
|
195
|
-
this.second = args.shift() || 0;
|
|
196
|
-
this.millisecond = args.shift() || 0;
|
|
197
|
-
(0, $5c0571aa5b6fb5da$exports.constrain)(this);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
201
|
-
// @ts-ignore
|
|
202
|
-
$625ad1e1f4c43bc1$var$_type3 = /*#__PURE__*/ new WeakMap();
|
|
203
|
-
class $625ad1e1f4c43bc1$export$d3b7288e7994edea {
|
|
204
|
-
/** Returns a copy of this date. */ copy() {
|
|
205
|
-
if (this.era) return new $625ad1e1f4c43bc1$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
206
|
-
else return new $625ad1e1f4c43bc1$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
207
|
-
}
|
|
208
|
-
/** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
|
|
209
|
-
return (0, $5c0571aa5b6fb5da$exports.addZoned)(this, duration);
|
|
210
|
-
}
|
|
211
|
-
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
|
|
212
|
-
return (0, $5c0571aa5b6fb5da$exports.subtractZoned)(this, duration);
|
|
213
|
-
}
|
|
214
|
-
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
|
|
215
|
-
return (0, $5c0571aa5b6fb5da$exports.setZoned)(this, fields, disambiguation);
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
219
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
220
|
-
*/ cycle(field, amount, options) {
|
|
221
|
-
return (0, $5c0571aa5b6fb5da$exports.cycleZoned)(this, field, amount, options);
|
|
222
|
-
}
|
|
223
|
-
/** Converts the date to a native JavaScript Date object. */ toDate() {
|
|
224
|
-
return (0, $4ae0260a69729f1d$exports.zonedToDate)(this);
|
|
225
|
-
}
|
|
226
|
-
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
|
|
227
|
-
return (0, $4c32e2d98e5a5134$exports.zonedDateTimeToString)(this);
|
|
228
|
-
}
|
|
229
|
-
/** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
|
|
230
|
-
return this.toDate().toISOString();
|
|
231
|
-
}
|
|
232
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
233
|
-
// TODO: Is this a bad idea??
|
|
234
|
-
return this.toDate().getTime() - (0, $4ae0260a69729f1d$exports.toZoned)(b, this.timeZone).toDate().getTime();
|
|
235
|
-
}
|
|
236
|
-
constructor(...args){
|
|
237
|
-
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type3, {
|
|
238
|
-
writable: true,
|
|
239
|
-
value: void 0
|
|
240
|
-
});
|
|
241
|
-
let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
|
|
242
|
-
let timeZone = args.shift();
|
|
243
|
-
let offset = args.shift();
|
|
244
|
-
this.calendar = calendar;
|
|
245
|
-
this.era = era;
|
|
246
|
-
this.year = year;
|
|
247
|
-
this.month = month;
|
|
248
|
-
this.day = day;
|
|
249
|
-
this.timeZone = timeZone;
|
|
250
|
-
this.offset = offset;
|
|
251
|
-
this.hour = args.shift() || 0;
|
|
252
|
-
this.minute = args.shift() || 0;
|
|
253
|
-
this.second = args.shift() || 0;
|
|
254
|
-
this.millisecond = args.shift() || 0;
|
|
255
|
-
(0, $5c0571aa5b6fb5da$exports.constrain)(this);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
//# sourceMappingURL=CalendarDate.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AASD,SAAS,gCAAU,IAAW;IAC5B,IAAI,WAAqB,OAAO,IAAI,CAAC,EAAE,KAAK,WACxC,KAAK,KAAK,KACV,IAAI,CAAA,GAAA,2CAAgB;IAExB,IAAI;IACJ,IAAI,OAAO,IAAI,CAAC,EAAE,KAAK,UACrB,MAAM,KAAK,KAAK;SACX;QACL,IAAI,OAAO,SAAS,OAAO;QAC3B,MAAM,IAAI,CAAC,KAAK,MAAM,GAAG,EAAE;IAC7B;IAEA,IAAI,OAAO,KAAK,KAAK;IACrB,IAAI,QAAQ,KAAK,KAAK;IACtB,IAAI,MAAM,KAAK,KAAK;IAEpB,OAAO;QAAC;QAAU;QAAK;QAAM;QAAO;KAAI;AAC1C;IAIE,oFAAoF;AACpF,2FAA2F;AAC3F,0EAA0E;AAC1E,aAAa;AACb;AALK,MAAM;IAoCX,iCAAiC,GACjC,OAAqB;QACnB,IAAI,IAAI,CAAC,GAAG,EACV,OAAO,IAAI,0CAAa,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG;aAEhF,OAAO,IAAI,0CAAa,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG;IAE1E;IAEA,sEA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,CAAC,MAAM,GAAG,KAAK,KAAK,MAAM;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,MAAM;QAC9B,IAAI,CAAC,WAAW,GAAG,KAAK,KAAK,MAAM;QAEnC,CAAA,GAAA,mCAAQ,EAAE,IAAI;IAChB;AAsDF","sources":["packages/@internationalized/date/src/CalendarDate.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {add, addTime, addZoned, constrain, constrainTime, cycleDate, cycleTime, cycleZoned, set, setTime, setZoned, subtract, subtractTime, subtractZoned} from './manipulation';\nimport {AnyCalendarDate, AnyTime, Calendar, CycleOptions, CycleTimeOptions, DateDuration, DateField, DateFields, DateTimeDuration, Disambiguation, TimeDuration, TimeField, TimeFields} from './types';\nimport {compareDate, compareTime} from './queries';\nimport {dateTimeToString, dateToString, timeToString, zonedDateTimeToString} from './string';\nimport {GregorianCalendar} from './calendars/GregorianCalendar';\nimport {toCalendarDateTime, toDate, toZoned, zonedToDate} from './conversion';\n\nfunction shiftArgs(args: any[]) {\n let calendar: Calendar = typeof args[0] === 'object'\n ? args.shift()\n : new GregorianCalendar();\n\n let era: string;\n if (typeof args[0] === 'string') {\n era = args.shift();\n } else {\n let eras = calendar.getEras();\n era = eras[eras.length - 1];\n }\n\n let year = args.shift();\n let month = args.shift();\n let day = args.shift();\n\n return [calendar, era, year, month, day];\n}\n\n/** A CalendarDate represents a date without any time components in a specific calendar system. */\nexport class CalendarDate {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.\n // If that behavior is desired, use the AnyCalendarDate interface instead.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n\n constructor(year: number, month: number, day: number);\n constructor(era: string, year: number, month: number, day: number);\n constructor(calendar: Calendar, year: number, month: number, day: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): CalendarDate {\n if (this.era) {\n return new CalendarDate(this.calendar, this.era, this.year, this.month, this.day);\n } else {\n return new CalendarDate(this.calendar, this.year, this.month, this.day);\n }\n }\n\n /** Returns a new `CalendarDate` with the given duration added to it. */\n add(duration: DateDuration): CalendarDate {\n return add(this, duration);\n }\n\n /** Returns a new `CalendarDate` with the given duration subtracted from it. */\n subtract(duration: DateDuration): CalendarDate {\n return subtract(this, duration);\n }\n\n /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields): CalendarDate {\n return set(this, fields);\n }\n\n /**\n * Returns a new `CalendarDate` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField, amount: number, options?: CycleOptions): CalendarDate {\n return cycleDate(this, field, amount, options);\n }\n\n /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */\n toDate(timeZone: string): Date {\n return toDate(this, timeZone);\n }\n\n /** Converts the date to an ISO 8601 formatted string. */\n toString(): string {\n return dateToString(this);\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: AnyCalendarDate): number {\n return compareDate(this, b);\n }\n}\n\n/** A Time represents a clock time without any date components. */\nexport class Time {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The hour, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n\n constructor(\n hour: number = 0,\n minute: number = 0,\n second: number = 0,\n millisecond: number = 0\n ) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n constrainTime(this);\n }\n\n /** Returns a copy of this time. */\n copy(): Time {\n return new Time(this.hour, this.minute, this.second, this.millisecond);\n }\n\n /** Returns a new `Time` with the given duration added to it. */\n add(duration: TimeDuration): Time {\n return addTime(this, duration);\n }\n\n /** Returns a new `Time` with the given duration subtracted from it. */\n subtract(duration: TimeDuration): Time {\n return subtractTime(this, duration);\n }\n\n /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: TimeFields): Time {\n return setTime(this, fields);\n }\n\n /**\n * Returns a new `Time` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: TimeField, amount: number, options?: CycleTimeOptions): Time {\n return cycleTime(this, field, amount, options);\n }\n\n /** Converts the time to an ISO 8601 formatted string. */\n toString(): string {\n return timeToString(this);\n }\n\n /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */\n compare(b: AnyTime): number {\n return compareTime(this, b);\n }\n}\n\n/** A CalendarDateTime represents a date and time without a time zone, in a specific calendar system. */\nexport class CalendarDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n /** The hour in the day, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n\n constructor(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(era: string, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): CalendarDateTime {\n if (this.era) {\n return new CalendarDateTime(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n } else {\n return new CalendarDateTime(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n }\n }\n\n /** Returns a new `CalendarDateTime` with the given duration added to it. */\n add(duration: DateTimeDuration): CalendarDateTime {\n return add(this, duration);\n }\n\n /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */\n subtract(duration: DateTimeDuration): CalendarDateTime {\n return subtract(this, duration);\n }\n\n /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields & TimeFields): CalendarDateTime {\n return set(setTime(this, fields), fields);\n }\n\n /**\n * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField | TimeField, amount: number, options?: CycleTimeOptions): CalendarDateTime {\n switch (field) {\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return cycleDate(this, field, amount, options);\n default:\n return cycleTime(this, field, amount, options);\n }\n }\n\n /** Converts the date to a native JavaScript Date object in the given time zone. */\n toDate(timeZone: string, disambiguation?: Disambiguation): Date {\n return toDate(this, timeZone, disambiguation);\n }\n\n /** Converts the date to an ISO 8601 formatted string. */\n toString(): string {\n return dateTimeToString(this);\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: CalendarDate | CalendarDateTime | ZonedDateTime): number {\n let res = compareDate(this, b);\n if (res === 0) {\n return compareTime(this, toCalendarDateTime(b));\n }\n\n return res;\n }\n}\n\n/** A ZonedDateTime represents a date and time in a specific time zone and calendar system. */\nexport class ZonedDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n /** The hour in the day, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n /** The IANA time zone identifier that this date and time is represented in. */\n public readonly timeZone: string;\n /** The UTC offset for this time, in milliseconds. */\n public readonly offset: number;\n\n constructor(year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(era: string, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n let timeZone = args.shift();\n let offset = args.shift();\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.timeZone = timeZone;\n this.offset = offset;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): ZonedDateTime {\n if (this.era) {\n return new ZonedDateTime(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n } else {\n return new ZonedDateTime(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n }\n }\n\n /** Returns a new `ZonedDateTime` with the given duration added to it. */\n add(duration: DateTimeDuration): ZonedDateTime {\n return addZoned(this, duration);\n }\n\n /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */\n subtract(duration: DateTimeDuration): ZonedDateTime {\n return subtractZoned(this, duration);\n }\n\n /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields & TimeFields, disambiguation?: Disambiguation): ZonedDateTime {\n return setZoned(this, fields, disambiguation);\n }\n\n /**\n * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField | TimeField, amount: number, options?: CycleTimeOptions): ZonedDateTime {\n return cycleZoned(this, field, amount, options);\n }\n\n /** Converts the date to a native JavaScript Date object. */\n toDate(): Date {\n return zonedToDate(this);\n }\n\n /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */\n toString(): string {\n return zonedDateTimeToString(this);\n }\n\n /** Converts the date to an ISO 8601 formatted string in UTC. */\n toAbsoluteString(): string {\n return this.toDate().toISOString();\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: CalendarDate | CalendarDateTime | ZonedDateTime): number {\n // TODO: Is this a bad idea??\n return this.toDate().getTime() - toZoned(b, this.timeZone).toDate().getTime();\n }\n}\n"],"names":[],"version":3,"file":"CalendarDate.main.js.map"}
|