Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
786e613
docs(readme): add information about wasm package (#429)
lsndr Jun 22, 2025
ed83f82
build(deps-dev): bump @types/luxon from 3.4.2 to 3.6.2 (#423)
dependabot[bot] Jun 22, 2025
89f4897
build(deps): bump napi-build from 2.2.0 to 2.2.1 (#426)
dependabot[bot] Jun 22, 2025
f11ef0a
build(deps-dev): bump @commitlint/config-conventional (#407)
dependabot[bot] Jun 22, 2025
c39ad2b
build(deps): bump rrule from 0.13.0 to 0.14.0 (#430)
lsndr Jun 22, 2025
4e1bed7
chore(dependabot): switch to weekly scheduler (#432)
lsndr Jun 22, 2025
57d9ebd
build(deps-dev): bump semantic-release from 23.1.1 to 24.2.5 (#425)
dependabot[bot] Jun 22, 2025
ed43bec
build(deps-dev): bump ts-jest from 29.3.4 to 29.4.0 (#436)
dependabot[bot] Jun 22, 2025
e6ef376
build(deps-dev): bump typescript-eslint from 8.32.1 to 8.34.1 (#434)
dependabot[bot] Jun 22, 2025
344ec48
build(deps-dev): bump @eslint/compat from 1.2.9 to 1.3.0 (#433)
dependabot[bot] Jun 22, 2025
446d51e
docs(readme): rephrase (#437)
lsndr Jun 22, 2025
68cfeaf
Merge pull request #438 from lsndr/next
lsndr Jun 23, 2025
62465e0
Merge pull request #439 from lsndr/master
lsndr Jun 23, 2025
b94f54b
build(deps-dev): bump @eslint/js from 9.27.0 to 9.29.0 (#444)
dependabot[bot] Jun 24, 2025
2d96400
build(deps-dev): bump @commitlint/cli from 19.3.0 to 19.8.1 (#443)
dependabot[bot] Jun 24, 2025
b032ae1
build(deps-dev): bump husky from 9.1.4 to 9.1.7 (#441)
dependabot[bot] Jun 24, 2025
c3fac27
build(deps-dev): bump eslint-plugin-import-x from 4.12.2 to 4.15.2 (#…
dependabot[bot] Jun 24, 2025
890ec61
build(deps-dev): bump eslint from 9.27.0 to 9.30.0 (#447)
dependabot[bot] Jul 1, 2025
1d96a64
build(deps): bump napi-build from 2.2.1 to 2.2.2 (#448)
dependabot[bot] Jul 1, 2025
231312f
build(deps): bump indexmap from 2.9.0 to 2.10.0 (#446)
dependabot[bot] Jul 1, 2025
be6307a
build(deps-dev): bump eslint-import-resolver-typescript (#450)
dependabot[bot] Jul 1, 2025
fd207a0
build(deps-dev): bump semantic-release from 24.2.5 to 24.2.6 (#445)
dependabot[bot] Jul 1, 2025
69df21e
build(deps-dev): bump typescript-eslint from 8.34.1 to 8.36.0 (#456)
dependabot[bot] Jul 8, 2025
339316e
build(deps-dev): bump prettier from 3.5.3 to 3.6.2 (#454)
dependabot[bot] Jul 8, 2025
5025ca1
build(deps-dev): bump eslint-plugin-import-x from 4.15.2 to 4.16.1 (#…
dependabot[bot] Jul 8, 2025
c3547cc
build(deps-dev): bump @eslint/compat from 1.3.0 to 1.3.1 (#452)
dependabot[bot] Jul 8, 2025
dafdb58
fix: do not add `TZID` for utc datetime (#464)
florian-lackner365 Jul 22, 2025
47fdd7c
build(deps-dev): bump eslint from 9.30.0 to 9.31.0 (#459)
dependabot[bot] Jul 22, 2025
c4e564c
build(deps-dev): bump semantic-release from 24.2.6 to 24.2.7 (#457)
dependabot[bot] Jul 22, 2025
db381af
Merge pull request #472 from lsndr/next
lsndr Jul 25, 2025
7853a93
Merge pull request #473 from lsndr/master
lsndr Jul 25, 2025
9eeca42
build(deps): bump chrono-tz from 0.10.3 to 0.10.4 (#461)
dependabot[bot] Jul 28, 2025
0bb3668
build(deps-dev): bump luxon from 3.6.1 to 3.7.1 (#460)
dependabot[bot] Jul 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ updates:
target-branch: 'next'
directory: '/'
schedule:
interval: 'daily'
interval: 'weekly'
- package-ecosystem: 'cargo'
target-branch: 'next'
directory: '/'
schedule:
interval: 'daily'
interval: 'weekly'
123 changes: 30 additions & 93 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ path = "lib/lib.rs"

[dependencies]
chrono = "0.4.41"
chrono-tz = "0.9.0"
indexmap = "2.9.0"
chrono-tz = "0.10.4"
indexmap = "2.10.0"
itertools = "0.14.0"
# Default enable napi5 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.16.17", default-features = false, features = ["napi5"] }
napi-derive = "2.16.13"
replace_with = "0.1.8"
rrule = { version = "0.13.0", features = ["exrule"] }
rrule = { version = "0.14.0", features = ["exrule"] }

[build-dependencies]
napi-build = "2.2.0"
napi-build = "2.2.2"

[profile.release]
lto = true
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@
[![npm downloads](https://img.shields.io/npm/dt/rrule-rust.svg)](https://www.npmjs.com/package/rrule-rust)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lsndr/rrule-rust/blob/master/LICENSE.md)

`rrule-rust` is a library for working with recurrence rules based on Rust's [rrule](https://crates.io/crates/rrule) crate
`rrule-rust` is a library for handling recurrence rules, powered by Rust's high-performance [rrule](https://crates.io/crates/rrule) crate.

1. [Quick Start](#quick-start)
2. [Performance](#performance)

## Quick Start

See [test folder](https://github.com/lsndr/rrule-rust/tree/master/tests) to find more use cases

```
npm i rrule-rust
```

If you need a browser-compatible version with WASM support, install it from the `alpha` channel:

```
npm i rrule-rust@alpha
```

> The WebAssembly (WASM) version is currently available on the `alpha` channel, as it relies on an alpha release of [napi.rs](https://napi.rs/). Once napi.rs v3 is officially released, WASM support will be included in the main (`latest`) release channel.

For more usage examples and advanced scenarios, see the [tests directory](https://github.com/lsndr/rrule-rust/tree/master/tests) in the repository.

```typescript
import { RRule, RRuleSet, Frequency, DateTime } from 'rrule-rust';

Expand All @@ -32,7 +40,7 @@ const set = new RRuleSet({
});

const dates = set.all(); // [ DateTime, DateTime, DateTime, DateTime, DateTime ]
const asString = set.toString(); // DTSTART;TZID=US/Eastern:19970902T090000\nFREQ=daily;COUNT=5;BYHOUR=9;BYMINUTE=0;BYSECOND=0
const asString = set.toString(); // DTSTART;TZID=US/Eastern:19970902T090000\nFREQ=DAILY;COUNT=5;BYHOUR=9;BYMINUTE=0;BYSECOND=0
```

## Performance
Expand All @@ -49,7 +57,7 @@ const asString = set.toString(); // DTSTART;TZID=US/Eastern:19970902T090000\nFRE
| UTC TZ | 15 904 ops/s | 108 538 ops/s | ~6x faster |
| Other TZ | 260 ops/s | 106 034 ops/s | ~400x faster |

You can run benchmarks using `npm run benchmark`
You can run benchmarks using `npm run benchmark`.

## License

Expand Down
5 changes: 4 additions & 1 deletion lib/rrule/dtstart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ impl DtStart {
let mut parameters = Parameters::new();

if let Some(tzid) = self.tzid {
parameters.insert("TZID".to_string(), tzid.to_string());
// UTC datetimes MUST NOT contain a TZID
if !self.datetime.utc() {
parameters.insert("TZID".to_string(), tzid.to_string());
}
}

let value: String = self.datetime.to_string();
Expand Down
5 changes: 4 additions & 1 deletion lib/rrule/exdate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ impl ExDate {
let mut parameters = Parameters::new();

if let Some(tzid) = self.tzid {
parameters.insert("TZID".to_string(), tzid.to_string());
// UTC datetimes MUST NOT contain a TZID
if !self.datetimes.iter().any(|datetime| datetime.utc()) {
parameters.insert("TZID".to_string(), tzid.to_string());
}
}

let value: String = self
Expand Down
5 changes: 4 additions & 1 deletion lib/rrule/rdate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ impl RDate {
let mut parameters = Parameters::new();

if let Some(tzid) = self.tzid {
parameters.insert("TZID".to_string(), tzid.to_string());
// UTC datetimes MUST NOT contain a TZID
if !self.datetimes.iter().any(|datetime| datetime.utc()) {
parameters.insert("TZID".to_string(), tzid.to_string());
}
}

let value: String = self
Expand Down
Loading
Loading