:::java
Recurrence recur = new Recurrence.Builder(Frequency.WEEKLY).count(5).build();
RecurrenceRule rrule = new RecurrenceRule(recur);
RecurrenceRuleScribe scribe = new RecurrenceRuleScribe();
String result = scribe.writeText(rrule, new WriteContext(ICalVersion.V2_0, new TimezoneInfo()));
System.out.println(result);
rrule = scribe.parseText(result, null, new ICalParameters(), new ParseContext());
recur = rrule.getValue();
System.out.println(recur.getFrequency());
System.out.println(recur.getCount());
Produces:
:::text
FREQ=WEEKLY;COUNT=5
WEEKLY
5
Last edit: Michael Angstadt 2015-10-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Help and Support" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hello!
I'd like to be able to parse & generate just an rrule String, rather than a
whole ical file. Is it possible?
Thanks!
John
Hi John. Sorry for the late reply. It sure is!
Produces:
Last edit: Michael Angstadt 2015-10-16