Ghost/ghost/admin/app/transforms/moment-date.js
2015-03-11 12:37:41 -06:00

17 lines
404 B
JavaScript

/* global moment */
var MomentDate = DS.Transform.extend({
deserialize: function (serialized) {
if (serialized) {
return moment(serialized);
}
return serialized;
},
serialize: function (deserialized) {
if (deserialized) {
return moment(deserialized).toDate();
}
return deserialized;
}
});
export default MomentDate;