rrule-temporal 0.2.7 → 0.3.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/dist/index.cjs +408 -84
- package/dist/index.d.cts +34 -4
- package/dist/index.d.ts +34 -4
- package/dist/index.js +408 -84
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -12,9 +12,15 @@ interface ManualOpts extends BaseOpts {
|
|
|
12
12
|
until?: Temporal.ZonedDateTime;
|
|
13
13
|
byHour?: number[];
|
|
14
14
|
byMinute?: number[];
|
|
15
|
+
bySecond?: number[];
|
|
15
16
|
byDay?: string[];
|
|
16
17
|
byMonth?: number[];
|
|
17
18
|
byMonthDay?: number[];
|
|
19
|
+
byYearDay?: number[];
|
|
20
|
+
byWeekNo?: number[];
|
|
21
|
+
bySetPos?: number[];
|
|
22
|
+
wkst?: string;
|
|
23
|
+
rDate?: (Date | Temporal.ZonedDateTime)[];
|
|
18
24
|
dtstart: Temporal.ZonedDateTime;
|
|
19
25
|
}
|
|
20
26
|
interface IcsOpts extends BaseOpts {
|
|
@@ -28,12 +34,13 @@ declare class RRuleTemporal {
|
|
|
28
34
|
constructor(params: {
|
|
29
35
|
rruleString: string;
|
|
30
36
|
} | ManualOpts);
|
|
37
|
+
private sanitizeOpts;
|
|
31
38
|
private rawAdvance;
|
|
32
|
-
/** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE
|
|
33
|
-
* keeping chronological order.
|
|
34
|
-
* original date is returned unchanged.
|
|
39
|
+
/** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE × BYSECOND
|
|
40
|
+
* combinations, keeping chronological order. If the options are not
|
|
41
|
+
* present the original date is returned unchanged.
|
|
35
42
|
*/
|
|
36
|
-
private
|
|
43
|
+
private expandByTime;
|
|
37
44
|
private nextCandidateSameDate;
|
|
38
45
|
private applyTimeOverride;
|
|
39
46
|
private computeFirst;
|
|
@@ -42,6 +49,8 @@ declare class RRuleTemporal {
|
|
|
42
49
|
private matchesByMonth;
|
|
43
50
|
private matchesByMonthDay;
|
|
44
51
|
private matchesAll;
|
|
52
|
+
private matchesByYearDay;
|
|
53
|
+
private matchesByWeekNo;
|
|
45
54
|
options(): ManualOpts;
|
|
46
55
|
/**
|
|
47
56
|
* Returns all occurrences of the rule.
|
|
@@ -49,6 +58,25 @@ declare class RRuleTemporal {
|
|
|
49
58
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
50
59
|
*/
|
|
51
60
|
all(iterator?: (date: Temporal.ZonedDateTime, i: number) => boolean): Temporal.ZonedDateTime[];
|
|
61
|
+
/**
|
|
62
|
+
* Converts rDate entries to ZonedDateTime and merges with existing dates.
|
|
63
|
+
* @param dates - Array of dates to merge with
|
|
64
|
+
* @returns Merged and deduplicated array of dates
|
|
65
|
+
*/
|
|
66
|
+
private mergeAndDeduplicateRDates;
|
|
67
|
+
/**
|
|
68
|
+
* Applies count limit and merges rDates with the rule-generated dates.
|
|
69
|
+
* @param dates - Array of dates generated by the rule
|
|
70
|
+
* @param iterator - Optional iterator function
|
|
71
|
+
* @returns Final array of dates after merging and applying count limit
|
|
72
|
+
*/
|
|
73
|
+
private applyCountLimitAndMergeRDates;
|
|
74
|
+
/**
|
|
75
|
+
* Checks if the count limit should break the loop based on rDate presence.
|
|
76
|
+
* @param matchCount - Current number of matches
|
|
77
|
+
* @returns true if the loop should break
|
|
78
|
+
*/
|
|
79
|
+
private shouldBreakForCountLimit;
|
|
52
80
|
/**
|
|
53
81
|
* Returns all occurrences of the rule within a specified time window.
|
|
54
82
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
@@ -87,6 +115,8 @@ declare class RRuleTemporal {
|
|
|
87
115
|
* if BYMONTH is not specified.
|
|
88
116
|
*/
|
|
89
117
|
private generateYearlyOccurrences;
|
|
118
|
+
private applyBySetPos;
|
|
119
|
+
private mergeRDates;
|
|
90
120
|
}
|
|
91
121
|
|
|
92
122
|
export { type DateFormatter, type RRuleOptions, RRuleTemporal };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,9 +12,15 @@ interface ManualOpts extends BaseOpts {
|
|
|
12
12
|
until?: Temporal.ZonedDateTime;
|
|
13
13
|
byHour?: number[];
|
|
14
14
|
byMinute?: number[];
|
|
15
|
+
bySecond?: number[];
|
|
15
16
|
byDay?: string[];
|
|
16
17
|
byMonth?: number[];
|
|
17
18
|
byMonthDay?: number[];
|
|
19
|
+
byYearDay?: number[];
|
|
20
|
+
byWeekNo?: number[];
|
|
21
|
+
bySetPos?: number[];
|
|
22
|
+
wkst?: string;
|
|
23
|
+
rDate?: (Date | Temporal.ZonedDateTime)[];
|
|
18
24
|
dtstart: Temporal.ZonedDateTime;
|
|
19
25
|
}
|
|
20
26
|
interface IcsOpts extends BaseOpts {
|
|
@@ -28,12 +34,13 @@ declare class RRuleTemporal {
|
|
|
28
34
|
constructor(params: {
|
|
29
35
|
rruleString: string;
|
|
30
36
|
} | ManualOpts);
|
|
37
|
+
private sanitizeOpts;
|
|
31
38
|
private rawAdvance;
|
|
32
|
-
/** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE
|
|
33
|
-
* keeping chronological order.
|
|
34
|
-
* original date is returned unchanged.
|
|
39
|
+
/** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE × BYSECOND
|
|
40
|
+
* combinations, keeping chronological order. If the options are not
|
|
41
|
+
* present the original date is returned unchanged.
|
|
35
42
|
*/
|
|
36
|
-
private
|
|
43
|
+
private expandByTime;
|
|
37
44
|
private nextCandidateSameDate;
|
|
38
45
|
private applyTimeOverride;
|
|
39
46
|
private computeFirst;
|
|
@@ -42,6 +49,8 @@ declare class RRuleTemporal {
|
|
|
42
49
|
private matchesByMonth;
|
|
43
50
|
private matchesByMonthDay;
|
|
44
51
|
private matchesAll;
|
|
52
|
+
private matchesByYearDay;
|
|
53
|
+
private matchesByWeekNo;
|
|
45
54
|
options(): ManualOpts;
|
|
46
55
|
/**
|
|
47
56
|
* Returns all occurrences of the rule.
|
|
@@ -49,6 +58,25 @@ declare class RRuleTemporal {
|
|
|
49
58
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
50
59
|
*/
|
|
51
60
|
all(iterator?: (date: Temporal.ZonedDateTime, i: number) => boolean): Temporal.ZonedDateTime[];
|
|
61
|
+
/**
|
|
62
|
+
* Converts rDate entries to ZonedDateTime and merges with existing dates.
|
|
63
|
+
* @param dates - Array of dates to merge with
|
|
64
|
+
* @returns Merged and deduplicated array of dates
|
|
65
|
+
*/
|
|
66
|
+
private mergeAndDeduplicateRDates;
|
|
67
|
+
/**
|
|
68
|
+
* Applies count limit and merges rDates with the rule-generated dates.
|
|
69
|
+
* @param dates - Array of dates generated by the rule
|
|
70
|
+
* @param iterator - Optional iterator function
|
|
71
|
+
* @returns Final array of dates after merging and applying count limit
|
|
72
|
+
*/
|
|
73
|
+
private applyCountLimitAndMergeRDates;
|
|
74
|
+
/**
|
|
75
|
+
* Checks if the count limit should break the loop based on rDate presence.
|
|
76
|
+
* @param matchCount - Current number of matches
|
|
77
|
+
* @returns true if the loop should break
|
|
78
|
+
*/
|
|
79
|
+
private shouldBreakForCountLimit;
|
|
52
80
|
/**
|
|
53
81
|
* Returns all occurrences of the rule within a specified time window.
|
|
54
82
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
@@ -87,6 +115,8 @@ declare class RRuleTemporal {
|
|
|
87
115
|
* if BYMONTH is not specified.
|
|
88
116
|
*/
|
|
89
117
|
private generateYearlyOccurrences;
|
|
118
|
+
private applyBySetPos;
|
|
119
|
+
private mergeRDates;
|
|
90
120
|
}
|
|
91
121
|
|
|
92
122
|
export { type DateFormatter, type RRuleOptions, RRuleTemporal };
|