2017-09-19 14:47:10 +00:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
|
2020-06-11 21:23:00 +00:00
|
|
|
export default class TaskEventSerializer extends ApplicationSerializer {
|
|
|
|
attrs = {
|
2018-03-28 19:52:02 +00:00
|
|
|
message: 'DisplayMessage',
|
2020-06-11 21:23:00 +00:00
|
|
|
};
|
2018-03-28 19:52:02 +00:00
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
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.TimeNanos = hash.Time % 1000000;
|
2017-11-30 23:08:31 +00:00
|
|
|
hash.Time = Math.floor(hash.Time / 1000000);
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-11 21:23:00 +00:00
|
|
|
return super.normalize(typeHash, hash);
|
|
|
|
}
|
|
|
|
}
|