-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Do not output DTSTART in toString() #83
Comments
also plus 1 this |
Agreed - this is causing some grief when interoperating with other implementations (e.g. Python dateutil) |
👍 for this issue AFAIK, DTSTART is always supposed to be a different line, not just delimited by
I do not think (but await correction if wrong) that concatenating these lines with a |
@jkbrzt do you accept Pull Requests for this? Since this would be a breaking change, I could imagine implementing it in a separate function, e.g. |
For anyone else running across this issue, I created a helper function which seems to work for my needs (note: it's written in typescript) export function rrulesetToIcalString(schedule: RRuleSet, startDate: Moment): string {
// matches `;DTSTART=20180125T080000Z` until `;` or end
const icalStrings = schedule.valueOf().map(ruleString => ruleString.replace(/;DTSTART=.*?(?=(?:;)|$)/, ''));
icalStrings.unshift(`DTSTART;TZID=UTC:${startDate.utc().format('YYYYMMDDTHHmmss')}`);
return icalStrings.join('\n');
} You give it a Note: I think there's only suppose to be one |
To get a compliant rrule string (without the DTSTART), one option is to use
|
Any update on this? Not too difficult to get a compliant rrule string, thanks to @phillbaker's advice, but would be nice to be able to plug and play with Python's dateutil. |
Agreed, there are some differences in syntax with the RFC and with Python. Would be very open to a pull request addressing this! |
Now that |
^ my last statement here ("the library can no longer parse strings that it outputs") is now incorrect, this was just fixed by #267. Still, it would be ideal to conform to the RFC! |
Fixed by #269 |
DTSTART and DTEND is not part of iCalendar RRULE and should not be included when doing .toString().
Perhaps generate something like "DTSTART=x;DTEND=x;RRULE=x" which would be valid iCalendar syntax.
The text was updated successfully, but these errors were encountered: