1
0
mirror of https://github.com/TryGhost/Ghost.git synced 2024-12-16 04:08:34 +03:00
Ghost/ghost/admin/transforms/moment-date.js

17 lines
404 B
JavaScript
Raw Normal View History

/* 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;