vikramkakkar / SublimePicker

A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.
Apache License 2.0
2.31k stars 407 forks source link

Append RRULE: to the beginning of every generated rrule. #33

Open CCorrado opened 8 years ago

CCorrado commented 8 years ago

Looks like the rrule that sublime picker generates is incorrect for other parsing libraries (such as the RFC2445 date iterator)

Sublime generates "FREQ=DAILY;INTERVAL=10;" etc.. but what is needed is "RRULE:FREQ=DAILY;INTERVAL=10;"

I can open a PR for this. Should be very simple to append "RRULE:" at the beginning of each generated rule. I'd also like to see SublimePicker generate an RRULE for all occurrences, not just Custom ones. Any reason why this wasn't done? I am manually doing so in my app each time the user selects a recurrence...

vikramkakkar commented 8 years ago

Agreed, RRULE: should be prefixed to every recurrence rule supplied by SublimePicker.

I'd also like to see SublimePicker generate an RRULE for all occurrences, not just Custom ones. Any reason why this wasn't done?

I can see how this could be done for Every Day | Every Month | Every Year: FREQ=DAILY | FREQ=MONTHLY | FREQ=YEARLY. But how do you generate the recurrence rule for Every Week since it would have to include the BYDAY parameter?

For instance, SublimePicker would return the recurrence rule FREQ=WEEKLY;WKST=MON;BYDAY=SA if I ask it right now. Should this be considered equivalent to Every Week?

CCorrado commented 8 years ago

Sorry for not opening that PR! I got very sidetracked with the app I'm building. Actually, with the RFC 2445 library I'm using that generates the dates based on rrule, it takes in a start java.util.date type as well. So if "RRULE:FREQ=WEEKLY;" then it will generate dates 7 days ahead of the start date. It's clever enough to know.

CCorrado commented 8 years ago

I had written some unit tests with that library. Unfortunately I'm not near my laptop, maybe tomorrow ill hop on and get them to you.

CCorrado commented 8 years ago

https://github.com/jcvanderwal/google-rfc-2445 for reference