Ghost/ghost/admin/app/transforms/moment-date.js
Kevin Ansfield 9487ff9bae switch to ember-cli-moment-shim (#622)
no issue

- preparation for using `ember-pikaday` that utilizes `ember-cli-moment-shim`
- removes usage of `moment` global
- removes custom imports of `moment` and `moment-timezone` libraries
2017-04-05 19:45:35 +02:00

19 lines
407 B
JavaScript

import moment from 'moment';
import Transform from 'ember-data/transform';
export default Transform.extend({
deserialize(serialized) {
if (serialized) {
return moment(serialized);
}
return serialized;
},
serialize(deserialized) {
if (deserialized) {
return moment(deserialized).toDate();
}
return deserialized;
}
});