-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RRuleSet::set_from_string
to support loading rules without DTSTART
#105
Conversation
The way this will be used is like this? RRuleSet::new(date_time)
.set_from_string(google_rrule_string) |
@fmeringdal correct. The name |
ecf5076
to
e039297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add an entry to the changelog for this new function and a line about the motivating use-case for it?
It is good enough, naming is hard :) |
d65f491
to
1c506ab
Compare
Done 👍 |
Thanks again. I am aiming for a release later this week that will include these changes. |
This allows creating an RRuleSet without a DTSTART (see fmeringdal/rust-rrule#105)
This PR adds a new method to RRuleSet called
set_from_string
which is similar to theFromStr
implementation but allows passing rules without a DTSTART line. This is useful in particular when working with Google's API, which provides the rrule without the DTSTART:As it stands today, because the entire parser module is private, you would need to format a DTSTART line and add it to the rrule (only for it to be parsed again).
I pulled out the common logic in
from_str
to a privateset_from_content_lines
method to avoid duplication.