lsndr / rrule-rust Goto Github PK
View Code? Open in Web Editor NEWLibrary for working with recurrence rules written in rust
License: MIT License
Library for working with recurrence rules written in rust
License: MIT License
master
for latest
next
for next
This will represent DTSTART
property, like RRule
represents RRULE
class DtStart {
datetime: DateTime;
tzid: string;
}
exdate to setExdate() and etc.
This will be a breaking change
Current behavior:
export const enum Frequency
Desired behavior:
export enum Frequency
This will require to create enum definition on TS side, since non-const enums are generated by napi-rs
, so compatibility with TS is not guaranteed
Possible design:
class RRuleDate {
day: number;
month: number;
year: number;
hour: number;
minute: number;
second: number:
toDate(): Date {}
toUTCDate(): Date {}
}
Make sure this type is compatible with luxon's Date.fromObject
method
relates-to: #37
Iteration over RRuleSet
is much slower than using all
function. Method filter
can cover some of the iterator use cases. But it firstly requires research how fast it is.
public filter<S extends DateTime>(predicate: (value: DateTime, index: number) => value is S, limit?: number): DateTime[]
With the new API it's not possible to create an RRuleSet with the timezone set to "local", e.g. this fails:
new RRuleSet(DateTime.create(2024, 1, 1, 0, 0, 0, false), "local");
// => Error: 'local' is not a valid timezone
The reason is that timezones always get parsed with chrono_tz
and then passed into rrule::Tz::Tz
. Should local
and utc
be treated as a special string to instruct the RRuleSet
constructor to use rrule::Tz::LOCAL
or rrule::Tz::UTC
respectively?
e2e
folderAt the moment it is much slower than calling set.all()
. Iteration over set should not significantly differ from using all
method.
This task requires:
This will represent EXDATE
and RDATE
objects
class ExDate {
datetime: DateTime;
type: 'date' | 'date-time';
tzid?: string;
}
As for now it would be enough just to respect the timezone. In future we will need to provide api to set exdate
and rdate
with custom timezone (or we won't need because according to RFC, TZID in EXDATE/RDATE should be the same as in DTSTART).
Spec:
https://icalendar.org/iCalendar-RFC-5545/3-8-5-1-exception-date-times.html
https://icalendar.org/iCalendar-RFC-5545/3-8-5-2-recurrence-date-times.html
Requirements:
TZID
should be used in calculations,TZID
should be included in RRuleSet.toString()
result (?)I would like to discuss whether it would be better for the API to return JS date instances instead of UNIX timestamps. While this may make it slightly slower, it would also make it more convenient to use. In reality, it shouldn't have a significant impact since, on the JS side, timestamps would likely be converted into JS dates regardless. What was the main reason for choosing UNIX timestamps in the first place?
ubuntu-latest
ubuntu-latest
. Make it fail if its result is not in the expected rangeCommits like updating dev-deps, ci and e.t.c are not needed for users. They should be removed from release notes
index.ts
to dist
folderdist
from git (Not sure it's possible)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.