-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversion support to use RecurrenceRule with native code or export it (JSON) #30
Conversation
I'm not yet sure whether the proposed solution is the best approach because the JSON format does not seem to be standardized. If you want to pass a If conversion from/to JSON is really necessary, I'd prefer to support a standardized format like jCal (#3). It's similar to the JSON format in this PR, but, e.g., encodes frequencies and |
The RecurrenceRule String support is great, but it leaves you with the hassle to encode/decode it on native side to use it. |
I don't think that supporting both a standardized and a non-standardized JSON format would benefit users of this package, but rather create confusion and more code to maintain. If there are no native libraries for en-/decoding RRULE strings or jCal, I suggest doing either of the following:
|
Thanks for you input. I am sure I can work with the jCAL format. |
I created it back when I created this package to note some future ideas but didn't need it yet. It's now implemented and published as v0.2.6. |
Wow great! Thanks a lot for your awesome and fast support! |
Reason
To be able to use RecurrenceRules with native code (e.g. Method Channel) or to export it (e.g. to server), minimal support for to and from JSON conversion is needed.
Changes
fromJson
/toJson
functions forRecurrenceRule
andByWeekDayEntry
fromJson
/toJson
(json_compatibility_test.dart
)intToFrequency
/frequencyToInt
frequencyFromString
publicChecklist