Skip to content

Instantly share code, notes, and snippets.

@sapandiwakar
Created February 9, 2014 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapandiwakar/8895998 to your computer and use it in GitHub Desktop.
Save sapandiwakar/8895998 to your computer and use it in GitHub Desktop.
App.IsodateTransform = DS.Transform.extend({
deserialize: function (serialized) {
if (serialized) {
return moment(serialized).toDate();
}
return serialized;
},
serialize: function (deserialized) {
if (deserialized) {
return moment(deserialized).format();
}
return deserialized;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment