rrule-temporal 1.5.2 β 1.5.3
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 +1 -3
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# RRule Temporal
|
|
2
2
|
|
|
3
|
-
> This library is sponsored by [PostalForm π](https://postalform.com/?utm_source=github&utm_medium=readme&utm_campaign=rrule-temporal) β upload a PDF and we print + mail it via USPS (no printer or stamps needed). The only mailing platform for AI Agents via MCP, and the easiest one for humans!
|
|
4
|
-
|
|
5
3
|
The first and only fully compliant Recurrence rule ([RFC-5545](https://www.rfc-editor.org/rfc/rfc5545.html)) processing JS/TS library built on the Temporal API, now with support for [RFC-7529](https://www.rfc-editor.org/rfc/rfc7529.html) (RSCALE / SKIP) for non-Gregorian calendars.
|
|
6
4
|
The library accepts the familiar `RRULE` format and returns
|
|
7
5
|
`Temporal.ZonedDateTime` instances for easy timeβzone aware scheduling.
|
|
@@ -433,4 +431,4 @@ Both approaches preserve the original calendar, time-zone and nanosecond accurac
|
|
|
433
431
|
|
|
434
432
|
If this library saves you time, sponsorship helps keep it maintained.
|
|
435
433
|
|
|
436
|
-
|
|
434
|
+
> This library is sponsored by [PostalForm π](https://postalform.com/?utm_source=github&utm_medium=readme&utm_campaign=rrule-temporal) β upload a PDF and we print + mail it via USPS (no printer or stamps needed). The only mailing platform for AI Agents via MCP, and the easiest one for humans!
|
package/dist/index.cjs
CHANGED
|
@@ -91,6 +91,10 @@ function parseByDayToken(token) {
|
|
|
91
91
|
function isIcsOpts(opts) {
|
|
92
92
|
return typeof opts.rruleString === "string";
|
|
93
93
|
}
|
|
94
|
+
function mergeDateLists(parsedDates, suppliedDates) {
|
|
95
|
+
const merged = [...parsedDates ?? [], ...suppliedDates ?? []];
|
|
96
|
+
return merged.length > 0 ? merged : void 0;
|
|
97
|
+
}
|
|
94
98
|
/**
|
|
95
99
|
* Unfold lines according to RFC 5545 specification.
|
|
96
100
|
* Lines can be folded by inserting CRLF followed by a single linear white-space character.
|
|
@@ -339,6 +343,8 @@ var RRuleTemporal = class RRuleTemporal {
|
|
|
339
343
|
this.originalDtstart = RRuleTemporal.normalizeToPolyfill(parsed.dtstart);
|
|
340
344
|
manual = {
|
|
341
345
|
...parsed,
|
|
346
|
+
rDate: mergeDateLists(parsed.rDate, params.rDate),
|
|
347
|
+
exDate: mergeDateLists(parsed.exDate, params.exDate),
|
|
342
348
|
count: params.count ?? parsed.count,
|
|
343
349
|
until: params.until ?? parsed.until,
|
|
344
350
|
strict: params.strict,
|
package/dist/index.d.cts
CHANGED
|
@@ -70,6 +70,10 @@ interface IcsOpts extends BaseOpts {
|
|
|
70
70
|
count?: number;
|
|
71
71
|
/** UNTIL: last possible occurrence, used when missing from rruleString */
|
|
72
72
|
until?: Temporal.ZonedDateTime;
|
|
73
|
+
/** RDATE: additional dates to include */
|
|
74
|
+
rDate?: Temporal.ZonedDateTime[];
|
|
75
|
+
/** EXDATE: exception dates to exclude */
|
|
76
|
+
exDate?: Temporal.ZonedDateTime[];
|
|
73
77
|
}
|
|
74
78
|
type RRuleOptions = ManualOpts | IcsOpts;
|
|
75
79
|
type RRuleTemporalIterator = (date: Temporal.ZonedDateTime, i: number) => boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,10 @@ interface IcsOpts extends BaseOpts {
|
|
|
70
70
|
count?: number;
|
|
71
71
|
/** UNTIL: last possible occurrence, used when missing from rruleString */
|
|
72
72
|
until?: Temporal.ZonedDateTime;
|
|
73
|
+
/** RDATE: additional dates to include */
|
|
74
|
+
rDate?: Temporal.ZonedDateTime[];
|
|
75
|
+
/** EXDATE: exception dates to exclude */
|
|
76
|
+
exDate?: Temporal.ZonedDateTime[];
|
|
73
77
|
}
|
|
74
78
|
type RRuleOptions = ManualOpts | IcsOpts;
|
|
75
79
|
type RRuleTemporalIterator = (date: Temporal.ZonedDateTime, i: number) => boolean;
|
package/dist/index.js
CHANGED
|
@@ -90,6 +90,10 @@ function parseByDayToken(token) {
|
|
|
90
90
|
function isIcsOpts(opts) {
|
|
91
91
|
return typeof opts.rruleString === "string";
|
|
92
92
|
}
|
|
93
|
+
function mergeDateLists(parsedDates, suppliedDates) {
|
|
94
|
+
const merged = [...parsedDates ?? [], ...suppliedDates ?? []];
|
|
95
|
+
return merged.length > 0 ? merged : void 0;
|
|
96
|
+
}
|
|
93
97
|
/**
|
|
94
98
|
* Unfold lines according to RFC 5545 specification.
|
|
95
99
|
* Lines can be folded by inserting CRLF followed by a single linear white-space character.
|
|
@@ -338,6 +342,8 @@ var RRuleTemporal = class RRuleTemporal {
|
|
|
338
342
|
this.originalDtstart = RRuleTemporal.normalizeToPolyfill(parsed.dtstart);
|
|
339
343
|
manual = {
|
|
340
344
|
...parsed,
|
|
345
|
+
rDate: mergeDateLists(parsed.rDate, params.rDate),
|
|
346
|
+
exDate: mergeDateLists(parsed.exDate, params.exDate),
|
|
341
347
|
count: params.count ?? parsed.count,
|
|
342
348
|
until: params.until ?? parsed.until,
|
|
343
349
|
strict: params.strict,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rrule-temporal",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Recurrence rule (rrule) processing using Temporal PlainDate/PlainDateTime, with cross-timezone and cross-calendar rrule support",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build": "tsdown",
|
|
22
22
|
"test": "vitest run",
|
|
23
23
|
"coverage": "vitest run --coverage",
|
|
24
|
-
"format": "
|
|
24
|
+
"format": "prettier --write 'src/**/*.ts'",
|
|
25
25
|
"prepare": "npm run build"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|