rrule-temporal 1.5.0 → 1.5.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/README.md +26 -25
- package/dist/index.cjs +2676 -3017
- package/dist/index.d.cts +280 -279
- package/dist/index.d.ts +280 -279
- package/dist/index.js +2693 -11
- package/dist/totext.cjs +935 -3751
- package/dist/totext.d.cts +6 -5
- package/dist/totext.d.ts +6 -5
- package/dist/totext.js +934 -723
- package/package.json +7 -7
- package/dist/chunk-S4JPXM4U.js +0 -3015
package/README.md
CHANGED
|
@@ -37,30 +37,6 @@ rule.all().forEach(dt => console.log(dt.toString()));
|
|
|
37
37
|
const firstTen = rule.all((_, i) => i < 10);
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
## Benchmarks
|
|
41
|
-
|
|
42
|
-
Uncached median ops/s from the benchmark suite on a MacBook Pro M2 Max.
|
|
43
|
-
The full three-library comparison, including `rrule-rust`, lives in `benchmarks/README.md`.
|
|
44
|
-
|
|
45
|
-
| Scenario | TZ | rrule-temporal median ops/s | rrule median ops/s | vs rrule |
|
|
46
|
-
| --- | --- | ---: | ---: | ---: |
|
|
47
|
-
| 30 daily occurrences | UTC | 29,275 | 16,762 | 1.75x |
|
|
48
|
-
| 30 daily occurrences | America/Chicago | 2,067 | 364 | 5.68x |
|
|
49
|
-
| Daily weekdays across many cycles | UTC | 1,894 | 766 | 2.47x |
|
|
50
|
-
| Daily weekdays across many cycles | America/Chicago | 64.9 | 18.9 | 3.43x |
|
|
51
|
-
| 720 hourly occurrences | UTC | 1,499 | 701 | 2.14x |
|
|
52
|
-
| 720 hourly occurrences | America/Chicago | 104 | 14.1 | 7.38x |
|
|
53
|
-
| 1,440 minutely occurrences | UTC | 751 | 325 | 2.31x |
|
|
54
|
-
| 1,440 minutely occurrences | America/Chicago | 145 | 7.1 | 20.42x |
|
|
55
|
-
| Weekly MO/WE/FR across many cycles | UTC | 1,179 | 1,053 | 1.12x |
|
|
56
|
-
| Weekly MO/WE/FR across many cycles | America/Chicago | 64.4 | 14.6 | 4.41x |
|
|
57
|
-
| Monthly last weekday across 20 years | UTC | 1,953 | 948 | 2.06x |
|
|
58
|
-
| Monthly last weekday across 20 years | America/Chicago | 45.5 | 39.4 | 1.15x |
|
|
59
|
-
| Monthly first and last weekday across 20 years | UTC | 1,378 | 1,202 | 1.15x |
|
|
60
|
-
| Monthly first and last weekday across 20 years | America/Chicago | 40.0 | 24.2 | 1.65x |
|
|
61
|
-
|
|
62
|
-
The current pattern is straightforward: `rrule-temporal` is faster than `rrule` across all of the scenarios above, with especially large gains on timezone-heavy daily, hourly, and minutely rules. The biggest recent jump came from the UTC monthly `BYDAY` + `BYSETPOS` path, which is now ahead as well.
|
|
63
|
-
|
|
64
40
|
## Separating DTSTART and RRULE
|
|
65
41
|
|
|
66
42
|
Per RFC 5545, DTSTART and RRULE are separate properties. You can provide them separately:
|
|
@@ -190,6 +166,7 @@ rule.toString();
|
|
|
190
166
|
toText(rule); // uses the runtime locale, defaults to English
|
|
191
167
|
toText(rule, "es"); // Spanish description
|
|
192
168
|
toText(rule, "en", { includeDtstart: true }); // include "starting from <DTSTART date>"
|
|
169
|
+
toText(rule, "en", { excludeTzAbbreviation: true }); // omit timezone abbreviation in the output
|
|
193
170
|
toText(rule);
|
|
194
171
|
// "every day for 3 times"
|
|
195
172
|
|
|
@@ -323,9 +300,33 @@ Notes
|
|
|
323
300
|
| `next(after?, inclusive?)` | Next occurrence after a given date. |
|
|
324
301
|
| `previous(before?, inclusive?)` | Previous occurrence before a date. |
|
|
325
302
|
| `toString()` | Convert the rule back into `DTSTART` and `RRULE` lines. |
|
|
326
|
-
| `toText(rule, locale?, options?)` | Human readable description (`en`, `es`, `hi`, `yue`, `ar`, `he`, `zh`, `fr`). Options: `{ includeDtstart?: boolean }`. |
|
|
303
|
+
| `toText(rule, locale?, options?)` | Human readable description (`en`, `es`, `hi`, `yue`, `ar`, `he`, `zh`, `fr`). Options: `{ includeDtstart?: boolean, excludeTzAbbreviation?: boolean }`. |
|
|
327
304
|
| `options()` | Return the normalized options object. |
|
|
328
305
|
|
|
306
|
+
## Benchmarks
|
|
307
|
+
|
|
308
|
+
Uncached median ops/s from the benchmark suite on a MacBook Pro M2 Max.
|
|
309
|
+
The full three-library comparison, including `rrule-rust`, lives in `benchmarks/README.md`.
|
|
310
|
+
|
|
311
|
+
| Scenario | TZ | rrule-temporal median ops/s | rrule median ops/s | vs rrule |
|
|
312
|
+
| --- | --- | ---: | ---: | ---: |
|
|
313
|
+
| 30 daily occurrences | UTC | 29,275 | 16,762 | 1.75x |
|
|
314
|
+
| 30 daily occurrences | America/Chicago | 2,067 | 364 | 5.68x |
|
|
315
|
+
| Daily weekdays across many cycles | UTC | 1,894 | 766 | 2.47x |
|
|
316
|
+
| Daily weekdays across many cycles | America/Chicago | 64.9 | 18.9 | 3.43x |
|
|
317
|
+
| 720 hourly occurrences | UTC | 1,499 | 701 | 2.14x |
|
|
318
|
+
| 720 hourly occurrences | America/Chicago | 104 | 14.1 | 7.38x |
|
|
319
|
+
| 1,440 minutely occurrences | UTC | 751 | 325 | 2.31x |
|
|
320
|
+
| 1,440 minutely occurrences | America/Chicago | 145 | 7.1 | 20.42x |
|
|
321
|
+
| Weekly MO/WE/FR across many cycles | UTC | 1,179 | 1,053 | 1.12x |
|
|
322
|
+
| Weekly MO/WE/FR across many cycles | America/Chicago | 64.4 | 14.6 | 4.41x |
|
|
323
|
+
| Monthly last weekday across 20 years | UTC | 1,953 | 948 | 2.06x |
|
|
324
|
+
| Monthly last weekday across 20 years | America/Chicago | 45.5 | 39.4 | 1.15x |
|
|
325
|
+
| Monthly first and last weekday across 20 years | UTC | 1,378 | 1,202 | 1.15x |
|
|
326
|
+
| Monthly first and last weekday across 20 years | America/Chicago | 40.0 | 24.2 | 1.65x |
|
|
327
|
+
|
|
328
|
+
The current pattern is straightforward: `rrule-temporal` is faster than `rrule` across all of the scenarios above, with especially large gains on timezone-heavy daily, hourly, and minutely rules. The biggest recent jump came from the UTC monthly `BYDAY` + `BYSETPOS` path, which is now ahead as well.
|
|
329
|
+
|
|
329
330
|
## Further examples
|
|
330
331
|
|
|
331
332
|
Enumerating weekdays within a month or rotating through months can be achieved
|