rrule-temporal 1.1.2 → 1.1.4
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/chunk-BFYHWV7H.js +1395 -0
- package/dist/chunk-KT55S4C7.js +1590 -0
- package/dist/index.cjs +854 -599
- package/dist/index.d.cts +50 -9
- package/dist/index.d.ts +50 -9
- package/dist/index.js +1 -1
- package/dist/totext.cjs +854 -599
- package/dist/totext.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -56,15 +56,19 @@ interface IcsOpts extends BaseOpts {
|
|
|
56
56
|
rruleString: string;
|
|
57
57
|
}
|
|
58
58
|
type RRuleOptions = ManualOpts | IcsOpts;
|
|
59
|
+
type RRuleTemporalIterator = (date: Temporal.ZonedDateTime, i: number) => boolean;
|
|
60
|
+
type DateFilter = Date | Temporal.ZonedDateTime;
|
|
59
61
|
declare class RRuleTemporal {
|
|
60
|
-
private tzid;
|
|
61
|
-
private originalDtstart;
|
|
62
|
-
private opts;
|
|
63
|
-
private maxIterations;
|
|
64
|
-
private includeDtstart;
|
|
62
|
+
private readonly tzid;
|
|
63
|
+
private readonly originalDtstart;
|
|
64
|
+
private readonly opts;
|
|
65
|
+
private readonly maxIterations;
|
|
66
|
+
private readonly includeDtstart;
|
|
65
67
|
constructor(params: ({
|
|
66
68
|
rruleString: string;
|
|
67
69
|
} & BaseOpts) | ManualOpts);
|
|
70
|
+
private sanitizeNumericArray;
|
|
71
|
+
private sanitizeByDay;
|
|
68
72
|
private sanitizeOpts;
|
|
69
73
|
private rawAdvance;
|
|
70
74
|
/** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE × BYSECOND
|
|
@@ -77,18 +81,39 @@ declare class RRuleTemporal {
|
|
|
77
81
|
private computeFirst;
|
|
78
82
|
private matchesByDay;
|
|
79
83
|
private matchesByMonth;
|
|
84
|
+
private matchesNumericConstraint;
|
|
80
85
|
private matchesByMonthDay;
|
|
86
|
+
private matchesByHour;
|
|
87
|
+
private matchesByMinute;
|
|
88
|
+
private matchesBySecond;
|
|
81
89
|
private matchesAll;
|
|
82
90
|
private matchesByYearDay;
|
|
83
91
|
private getIsoWeekInfo;
|
|
84
92
|
private matchesByWeekNo;
|
|
85
93
|
options(): ManualOpts;
|
|
94
|
+
private addDtstartIfNeeded;
|
|
95
|
+
private processOccurrences;
|
|
86
96
|
/**
|
|
87
97
|
* Returns all occurrences of the rule.
|
|
88
98
|
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
89
99
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
90
100
|
*/
|
|
91
|
-
|
|
101
|
+
private _allMonthlyByDayOrMonthDay;
|
|
102
|
+
private _allWeekly;
|
|
103
|
+
private _allMonthlyByMonth;
|
|
104
|
+
private _allYearlyByMonth;
|
|
105
|
+
private _allYearlyComplex;
|
|
106
|
+
private _allMinutelySecondlyComplex;
|
|
107
|
+
private _allMonthlyByWeekNo;
|
|
108
|
+
private _allMonthlyByYearDay;
|
|
109
|
+
private _allDailyMinutelyHourlyWithBySetPos;
|
|
110
|
+
private _allFallback;
|
|
111
|
+
/**
|
|
112
|
+
* Returns all occurrences of the rule.
|
|
113
|
+
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
114
|
+
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
115
|
+
*/
|
|
116
|
+
all(iterator?: RRuleTemporalIterator): Temporal.ZonedDateTime[];
|
|
92
117
|
/**
|
|
93
118
|
* Converts rDate entries to ZonedDateTime and merges with existing dates.
|
|
94
119
|
* @param dates - Array of dates to merge with
|
|
@@ -121,22 +146,23 @@ declare class RRuleTemporal {
|
|
|
121
146
|
* @param inc - Optional boolean flag to include the end date in the results.
|
|
122
147
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
|
|
123
148
|
*/
|
|
124
|
-
between(after:
|
|
149
|
+
between(after: DateFilter, before: DateFilter, inc?: boolean): Temporal.ZonedDateTime[];
|
|
125
150
|
/**
|
|
126
151
|
* Returns the next occurrence of the rule after a specified date.
|
|
127
152
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
128
153
|
* @param inc - Optional boolean flag to include occurrences on the start date.
|
|
129
154
|
* @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
|
|
130
155
|
*/
|
|
131
|
-
next(after?:
|
|
156
|
+
next(after?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
|
|
132
157
|
/**
|
|
133
158
|
* Returns the previous occurrence of the rule before a specified date.
|
|
134
159
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
135
160
|
* @param inc - Optional boolean flag to include occurrences on the end date.
|
|
136
161
|
* @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
|
|
137
162
|
*/
|
|
138
|
-
previous(before?:
|
|
163
|
+
previous(before?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
|
|
139
164
|
toString(): string;
|
|
165
|
+
private formatIcsDateTime;
|
|
140
166
|
private joinDates;
|
|
141
167
|
/**
|
|
142
168
|
* Given any date in a month, return all the ZonedDateTimes in that month
|
|
@@ -149,7 +175,22 @@ declare class RRuleTemporal {
|
|
|
149
175
|
* if BYMONTH is not specified.
|
|
150
176
|
*/
|
|
151
177
|
private generateYearlyOccurrences;
|
|
178
|
+
private addByDay;
|
|
179
|
+
/**
|
|
180
|
+
* Helper to find the next valid value from a sorted array
|
|
181
|
+
*/
|
|
182
|
+
private findNextValidValue;
|
|
183
|
+
/**
|
|
184
|
+
* Efficiently find the next valid date for MINUTELY and SECONDLY frequency by jumping over
|
|
185
|
+
* large gaps when BYXXX constraints don't match.
|
|
186
|
+
*/
|
|
187
|
+
private findNextValidDate;
|
|
152
188
|
private applyBySetPos;
|
|
189
|
+
private isoWeekByDay;
|
|
190
|
+
/**
|
|
191
|
+
* Generate occurrences for a specific week number in a given year
|
|
192
|
+
*/
|
|
193
|
+
private generateOccurrencesForWeekInYear;
|
|
153
194
|
}
|
|
154
195
|
|
|
155
196
|
export { type RRuleOptions, RRuleTemporal };
|
package/dist/index.d.ts
CHANGED
|
@@ -56,15 +56,19 @@ interface IcsOpts extends BaseOpts {
|
|
|
56
56
|
rruleString: string;
|
|
57
57
|
}
|
|
58
58
|
type RRuleOptions = ManualOpts | IcsOpts;
|
|
59
|
+
type RRuleTemporalIterator = (date: Temporal.ZonedDateTime, i: number) => boolean;
|
|
60
|
+
type DateFilter = Date | Temporal.ZonedDateTime;
|
|
59
61
|
declare class RRuleTemporal {
|
|
60
|
-
private tzid;
|
|
61
|
-
private originalDtstart;
|
|
62
|
-
private opts;
|
|
63
|
-
private maxIterations;
|
|
64
|
-
private includeDtstart;
|
|
62
|
+
private readonly tzid;
|
|
63
|
+
private readonly originalDtstart;
|
|
64
|
+
private readonly opts;
|
|
65
|
+
private readonly maxIterations;
|
|
66
|
+
private readonly includeDtstart;
|
|
65
67
|
constructor(params: ({
|
|
66
68
|
rruleString: string;
|
|
67
69
|
} & BaseOpts) | ManualOpts);
|
|
70
|
+
private sanitizeNumericArray;
|
|
71
|
+
private sanitizeByDay;
|
|
68
72
|
private sanitizeOpts;
|
|
69
73
|
private rawAdvance;
|
|
70
74
|
/** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE × BYSECOND
|
|
@@ -77,18 +81,39 @@ declare class RRuleTemporal {
|
|
|
77
81
|
private computeFirst;
|
|
78
82
|
private matchesByDay;
|
|
79
83
|
private matchesByMonth;
|
|
84
|
+
private matchesNumericConstraint;
|
|
80
85
|
private matchesByMonthDay;
|
|
86
|
+
private matchesByHour;
|
|
87
|
+
private matchesByMinute;
|
|
88
|
+
private matchesBySecond;
|
|
81
89
|
private matchesAll;
|
|
82
90
|
private matchesByYearDay;
|
|
83
91
|
private getIsoWeekInfo;
|
|
84
92
|
private matchesByWeekNo;
|
|
85
93
|
options(): ManualOpts;
|
|
94
|
+
private addDtstartIfNeeded;
|
|
95
|
+
private processOccurrences;
|
|
86
96
|
/**
|
|
87
97
|
* Returns all occurrences of the rule.
|
|
88
98
|
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
89
99
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
90
100
|
*/
|
|
91
|
-
|
|
101
|
+
private _allMonthlyByDayOrMonthDay;
|
|
102
|
+
private _allWeekly;
|
|
103
|
+
private _allMonthlyByMonth;
|
|
104
|
+
private _allYearlyByMonth;
|
|
105
|
+
private _allYearlyComplex;
|
|
106
|
+
private _allMinutelySecondlyComplex;
|
|
107
|
+
private _allMonthlyByWeekNo;
|
|
108
|
+
private _allMonthlyByYearDay;
|
|
109
|
+
private _allDailyMinutelyHourlyWithBySetPos;
|
|
110
|
+
private _allFallback;
|
|
111
|
+
/**
|
|
112
|
+
* Returns all occurrences of the rule.
|
|
113
|
+
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
114
|
+
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
115
|
+
*/
|
|
116
|
+
all(iterator?: RRuleTemporalIterator): Temporal.ZonedDateTime[];
|
|
92
117
|
/**
|
|
93
118
|
* Converts rDate entries to ZonedDateTime and merges with existing dates.
|
|
94
119
|
* @param dates - Array of dates to merge with
|
|
@@ -121,22 +146,23 @@ declare class RRuleTemporal {
|
|
|
121
146
|
* @param inc - Optional boolean flag to include the end date in the results.
|
|
122
147
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
|
|
123
148
|
*/
|
|
124
|
-
between(after:
|
|
149
|
+
between(after: DateFilter, before: DateFilter, inc?: boolean): Temporal.ZonedDateTime[];
|
|
125
150
|
/**
|
|
126
151
|
* Returns the next occurrence of the rule after a specified date.
|
|
127
152
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
128
153
|
* @param inc - Optional boolean flag to include occurrences on the start date.
|
|
129
154
|
* @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
|
|
130
155
|
*/
|
|
131
|
-
next(after?:
|
|
156
|
+
next(after?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
|
|
132
157
|
/**
|
|
133
158
|
* Returns the previous occurrence of the rule before a specified date.
|
|
134
159
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
135
160
|
* @param inc - Optional boolean flag to include occurrences on the end date.
|
|
136
161
|
* @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
|
|
137
162
|
*/
|
|
138
|
-
previous(before?:
|
|
163
|
+
previous(before?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
|
|
139
164
|
toString(): string;
|
|
165
|
+
private formatIcsDateTime;
|
|
140
166
|
private joinDates;
|
|
141
167
|
/**
|
|
142
168
|
* Given any date in a month, return all the ZonedDateTimes in that month
|
|
@@ -149,7 +175,22 @@ declare class RRuleTemporal {
|
|
|
149
175
|
* if BYMONTH is not specified.
|
|
150
176
|
*/
|
|
151
177
|
private generateYearlyOccurrences;
|
|
178
|
+
private addByDay;
|
|
179
|
+
/**
|
|
180
|
+
* Helper to find the next valid value from a sorted array
|
|
181
|
+
*/
|
|
182
|
+
private findNextValidValue;
|
|
183
|
+
/**
|
|
184
|
+
* Efficiently find the next valid date for MINUTELY and SECONDLY frequency by jumping over
|
|
185
|
+
* large gaps when BYXXX constraints don't match.
|
|
186
|
+
*/
|
|
187
|
+
private findNextValidDate;
|
|
152
188
|
private applyBySetPos;
|
|
189
|
+
private isoWeekByDay;
|
|
190
|
+
/**
|
|
191
|
+
* Generate occurrences for a specific week number in a given year
|
|
192
|
+
*/
|
|
193
|
+
private generateOccurrencesForWeekInYear;
|
|
153
194
|
}
|
|
154
195
|
|
|
155
196
|
export { type RRuleOptions, RRuleTemporal };
|