2020-01-16 20:01:12 +03:00
|
|
|
import Transform from '@ember-data/serializer/transform';
|
2017-05-29 21:50:03 +03:00
|
|
|
import moment from 'moment';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
export default Transform.extend({
|
|
|
|
deserialize(serialized) {
|
2014-06-05 20:04:59 +04:00
|
|
|
if (serialized) {
|
|
|
|
return moment(serialized);
|
|
|
|
}
|
|
|
|
return serialized;
|
|
|
|
},
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
serialize(deserialized) {
|
2014-06-05 20:04:59 +04:00
|
|
|
if (deserialized) {
|
|
|
|
return moment(deserialized).toDate();
|
|
|
|
}
|
|
|
|
return deserialized;
|
|
|
|
}
|
|
|
|
});
|