Created
July 25, 2012 20:27
-
-
Save lightsofapollo/3178455 to your computer and use it in GitHub Desktop.
ICAL bikeshed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// some ical string; | |
var rawIcalString; | |
// my ical data - remove decorate parameter | |
var data = ICAL.parse(rawIcalString); | |
var component = new ICAL.Component(data); | |
// later I store it in the DB | |
var structuredCloneData; | |
var component = new ICAL.Component(structuredCloneData); | |
// mutate it | |
component.removeSubcomponent('FOO'); | |
component.addPropertyWithValue('foo', 'bar'); | |
// save it back to db | |
// this is now undecorated | |
var storable = component.toJSON(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and natually we can also have
And store objects as raw JSON strings.