rrule-temporal 1.6.0 → 2.0.1
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/README.md +60 -34
- package/dist/index.cjs +5 -2761
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +1 -2757
- package/dist/src-B0RsDEOV.cjs +7577 -0
- package/dist/src-DEpYefSo.js +7554 -0
- package/dist/totext.cjs +19 -21
- package/dist/totext.js +13 -15
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -22,6 +22,8 @@ interface BaseOpts {
|
|
|
22
22
|
rscale?: string;
|
|
23
23
|
/** SKIP behavior per RFC 7529: OMIT (default), BACKWARD, FORWARD (requires RSCALE). */
|
|
24
24
|
skip?: 'OMIT' | 'BACKWARD' | 'FORWARD';
|
|
25
|
+
/** Memoize the full occurrence list computed by all() (defaults to true). */
|
|
26
|
+
cache?: boolean;
|
|
25
27
|
}
|
|
26
28
|
type TemporalZonedDateTime = Temporal.ZonedDateTime;
|
|
27
29
|
type TemporalPlainDate = Temporal.PlainDate;
|
|
@@ -106,6 +108,10 @@ declare class RRuleTemporal {
|
|
|
106
108
|
private readonly canUseEpochMillisecondsPrecisionFlag;
|
|
107
109
|
private readonly timeSlotOffsetsMs?;
|
|
108
110
|
private readonly numericByMonths?;
|
|
111
|
+
private exDateEpochNs?;
|
|
112
|
+
private allResultCache?;
|
|
113
|
+
private zoneResolver?;
|
|
114
|
+
private emitAnchorZdt?;
|
|
109
115
|
private static readonly rscaleCalendarSupport;
|
|
110
116
|
/**
|
|
111
117
|
* Normalize a ZonedDateTime to the polyfill implementation.
|
|
@@ -179,6 +185,23 @@ declare class RRuleTemporal {
|
|
|
179
185
|
private generateMonthlyOccurrenceDaysUtc;
|
|
180
186
|
private generateMonthlyOccurrenceEpochsUtc;
|
|
181
187
|
private _allUtcMonthlyByDayOrMonthDay;
|
|
188
|
+
private getZoneResolver;
|
|
189
|
+
private zdtFromEpochMs;
|
|
190
|
+
/** Local wall-clock ms (as-if-UTC) of a ZonedDateTime with ms precision. */
|
|
191
|
+
private wallMsOf;
|
|
192
|
+
private canUseTzEpochFastPaths;
|
|
193
|
+
/**
|
|
194
|
+
* True if the rule's nominal time of day can be skipped by a DST gap
|
|
195
|
+
* anywhere in the (estimated) iteration range. The general engine chains
|
|
196
|
+
* its cursor through gap days — even filtered-out ones — permanently
|
|
197
|
+
* shifting the time of day, so affected rules must use it for parity.
|
|
198
|
+
*/
|
|
199
|
+
private tzFastPathGapHazard;
|
|
200
|
+
private allTzEpochFastPath;
|
|
201
|
+
private _allTzDailySimple;
|
|
202
|
+
private _allTzFixedStepSimple;
|
|
203
|
+
private _allTzWeeklySimple;
|
|
204
|
+
private _allTzMonthlyByDayOrMonthDay;
|
|
182
205
|
private processOccurrences;
|
|
183
206
|
/**
|
|
184
207
|
* Returns all occurrences of the rule.
|
|
@@ -248,6 +271,14 @@ declare class RRuleTemporal {
|
|
|
248
271
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
|
|
249
272
|
*/
|
|
250
273
|
between(after: DateFilter, before: DateFilter, inc?: boolean): TemporalZonedDateTime[];
|
|
274
|
+
/**
|
|
275
|
+
* Compute a rule-phase-aligned DTSTART at or just before the given window
|
|
276
|
+
* start, jumping forward from the original DTSTART in whole multiples of
|
|
277
|
+
* INTERVAL. Lets window queries skip iterating occurrences before the
|
|
278
|
+
* window without disturbing cadence. Not valid for COUNT-limited rules,
|
|
279
|
+
* where the occurrence set depends on the index from the true DTSTART.
|
|
280
|
+
*/
|
|
281
|
+
private jumpAlignedDtstart;
|
|
251
282
|
/**
|
|
252
283
|
* Convenience helper: true if the exact instant is an occurrence of the rule.
|
|
253
284
|
* This checks full date-time equality (including time and time zone).
|
|
@@ -265,6 +296,12 @@ declare class RRuleTemporal {
|
|
|
265
296
|
* @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
|
|
266
297
|
*/
|
|
267
298
|
next(after?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
299
|
+
/**
|
|
300
|
+
* Build a temporary rule identical to this one but starting at the
|
|
301
|
+
* phase-aligned DTSTART for the given window start. The synthetic DTSTART
|
|
302
|
+
* only keeps includeDtstart semantics when it coincides with the original.
|
|
303
|
+
*/
|
|
304
|
+
private ruleFromAlignedDtstart;
|
|
268
305
|
/**
|
|
269
306
|
* Returns the previous occurrence of the rule before a specified date.
|
|
270
307
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
@@ -272,6 +309,8 @@ declare class RRuleTemporal {
|
|
|
272
309
|
* @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
|
|
273
310
|
*/
|
|
274
311
|
previous(before?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
312
|
+
/** A duration of `count` steps in this rule's frequency unit. */
|
|
313
|
+
private freqDuration;
|
|
275
314
|
toString(): string;
|
|
276
315
|
private formatIcsDateTime;
|
|
277
316
|
private joinDates;
|
|
@@ -312,6 +351,8 @@ declare class RRuleTemporal {
|
|
|
312
351
|
private rscaleFirstWeekStart;
|
|
313
352
|
private rscaleLastWeekCount;
|
|
314
353
|
private lastDayOfMonth;
|
|
354
|
+
/** Convert an ambient ZonedDateTime into polyfill space for RSCALE math. */
|
|
355
|
+
private toRscaleZdt;
|
|
315
356
|
private buildZdtFromPlainDate;
|
|
316
357
|
private rscaleMatchesByYearDay;
|
|
317
358
|
private rscaleMatchesByWeekNo;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ interface BaseOpts {
|
|
|
22
22
|
rscale?: string;
|
|
23
23
|
/** SKIP behavior per RFC 7529: OMIT (default), BACKWARD, FORWARD (requires RSCALE). */
|
|
24
24
|
skip?: 'OMIT' | 'BACKWARD' | 'FORWARD';
|
|
25
|
+
/** Memoize the full occurrence list computed by all() (defaults to true). */
|
|
26
|
+
cache?: boolean;
|
|
25
27
|
}
|
|
26
28
|
type TemporalZonedDateTime = Temporal.ZonedDateTime;
|
|
27
29
|
type TemporalPlainDate = Temporal.PlainDate;
|
|
@@ -106,6 +108,10 @@ declare class RRuleTemporal {
|
|
|
106
108
|
private readonly canUseEpochMillisecondsPrecisionFlag;
|
|
107
109
|
private readonly timeSlotOffsetsMs?;
|
|
108
110
|
private readonly numericByMonths?;
|
|
111
|
+
private exDateEpochNs?;
|
|
112
|
+
private allResultCache?;
|
|
113
|
+
private zoneResolver?;
|
|
114
|
+
private emitAnchorZdt?;
|
|
109
115
|
private static readonly rscaleCalendarSupport;
|
|
110
116
|
/**
|
|
111
117
|
* Normalize a ZonedDateTime to the polyfill implementation.
|
|
@@ -179,6 +185,23 @@ declare class RRuleTemporal {
|
|
|
179
185
|
private generateMonthlyOccurrenceDaysUtc;
|
|
180
186
|
private generateMonthlyOccurrenceEpochsUtc;
|
|
181
187
|
private _allUtcMonthlyByDayOrMonthDay;
|
|
188
|
+
private getZoneResolver;
|
|
189
|
+
private zdtFromEpochMs;
|
|
190
|
+
/** Local wall-clock ms (as-if-UTC) of a ZonedDateTime with ms precision. */
|
|
191
|
+
private wallMsOf;
|
|
192
|
+
private canUseTzEpochFastPaths;
|
|
193
|
+
/**
|
|
194
|
+
* True if the rule's nominal time of day can be skipped by a DST gap
|
|
195
|
+
* anywhere in the (estimated) iteration range. The general engine chains
|
|
196
|
+
* its cursor through gap days — even filtered-out ones — permanently
|
|
197
|
+
* shifting the time of day, so affected rules must use it for parity.
|
|
198
|
+
*/
|
|
199
|
+
private tzFastPathGapHazard;
|
|
200
|
+
private allTzEpochFastPath;
|
|
201
|
+
private _allTzDailySimple;
|
|
202
|
+
private _allTzFixedStepSimple;
|
|
203
|
+
private _allTzWeeklySimple;
|
|
204
|
+
private _allTzMonthlyByDayOrMonthDay;
|
|
182
205
|
private processOccurrences;
|
|
183
206
|
/**
|
|
184
207
|
* Returns all occurrences of the rule.
|
|
@@ -248,6 +271,14 @@ declare class RRuleTemporal {
|
|
|
248
271
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
|
|
249
272
|
*/
|
|
250
273
|
between(after: DateFilter, before: DateFilter, inc?: boolean): TemporalZonedDateTime[];
|
|
274
|
+
/**
|
|
275
|
+
* Compute a rule-phase-aligned DTSTART at or just before the given window
|
|
276
|
+
* start, jumping forward from the original DTSTART in whole multiples of
|
|
277
|
+
* INTERVAL. Lets window queries skip iterating occurrences before the
|
|
278
|
+
* window without disturbing cadence. Not valid for COUNT-limited rules,
|
|
279
|
+
* where the occurrence set depends on the index from the true DTSTART.
|
|
280
|
+
*/
|
|
281
|
+
private jumpAlignedDtstart;
|
|
251
282
|
/**
|
|
252
283
|
* Convenience helper: true if the exact instant is an occurrence of the rule.
|
|
253
284
|
* This checks full date-time equality (including time and time zone).
|
|
@@ -265,6 +296,12 @@ declare class RRuleTemporal {
|
|
|
265
296
|
* @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
|
|
266
297
|
*/
|
|
267
298
|
next(after?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
299
|
+
/**
|
|
300
|
+
* Build a temporary rule identical to this one but starting at the
|
|
301
|
+
* phase-aligned DTSTART for the given window start. The synthetic DTSTART
|
|
302
|
+
* only keeps includeDtstart semantics when it coincides with the original.
|
|
303
|
+
*/
|
|
304
|
+
private ruleFromAlignedDtstart;
|
|
268
305
|
/**
|
|
269
306
|
* Returns the previous occurrence of the rule before a specified date.
|
|
270
307
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
@@ -272,6 +309,8 @@ declare class RRuleTemporal {
|
|
|
272
309
|
* @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
|
|
273
310
|
*/
|
|
274
311
|
previous(before?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
312
|
+
/** A duration of `count` steps in this rule's frequency unit. */
|
|
313
|
+
private freqDuration;
|
|
275
314
|
toString(): string;
|
|
276
315
|
private formatIcsDateTime;
|
|
277
316
|
private joinDates;
|
|
@@ -312,6 +351,8 @@ declare class RRuleTemporal {
|
|
|
312
351
|
private rscaleFirstWeekStart;
|
|
313
352
|
private rscaleLastWeekCount;
|
|
314
353
|
private lastDayOfMonth;
|
|
354
|
+
/** Convert an ambient ZonedDateTime into polyfill space for RSCALE math. */
|
|
355
|
+
private toRscaleZdt;
|
|
315
356
|
private buildZdtFromPlainDate;
|
|
316
357
|
private rscaleMatchesByYearDay;
|
|
317
358
|
private rscaleMatchesByWeekNo;
|