2017-04-05 20:45:35 +03:00
|
|
|
import moment from 'moment';
|
2016-01-12 22:23:01 +03:00
|
|
|
import Transform from 'ember-data/transform';
|
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;
|
|
|
|
}
|
|
|
|
});
|