open-nomad/ui/app/serializers/task-event.js

15 lines
524 B
JavaScript
Raw Normal View History

2017-09-19 14:47:10 +00:00
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
normalize(typeHash, hash) {
// Time is in the form of nanoseconds since epoch, but JS dates
// only understand time to the millisecond precision. So store
// the time (precise to ms) as a date, and store the remaining ns
// as a number to deal with when it comes up.
hash.Time = Math.floor(hash.Time / 1000000);
hash.TimeNanos = hash.Time % 1000000;
return this._super(typeHash, hash);
},
});