mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 19:07:37 +03:00
9487ff9bae
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
23 lines
502 B
JavaScript
23 lines
502 B
JavaScript
import moment from 'moment';
|
|
import Transform from 'ember-data/transform';
|
|
|
|
export default Transform.extend({
|
|
deserialize(serialized) {
|
|
if (serialized) {
|
|
return moment.utc(serialized);
|
|
}
|
|
return serialized;
|
|
},
|
|
|
|
serialize(deserialized) {
|
|
if (deserialized) {
|
|
try {
|
|
return deserialized.toJSON();
|
|
} catch (e) {
|
|
return deserialized;
|
|
}
|
|
}
|
|
return deserialized;
|
|
}
|
|
});
|