mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
18 lines
433 B
JavaScript
18 lines
433 B
JavaScript
import DS from 'ember-data';
|
|
/* 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;
|