github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/serializers/task-event.js (about) 1 import ApplicationSerializer from './application'; 2 3 export default ApplicationSerializer.extend({ 4 attrs: { 5 message: 'DisplayMessage', 6 }, 7 8 normalize(typeHash, hash) { 9 // Time is in the form of nanoseconds since epoch, but JS dates 10 // only understand time to the millisecond precision. So store 11 // the time (precise to ms) as a date, and store the remaining ns 12 // as a number to deal with when it comes up. 13 hash.TimeNanos = hash.Time % 1000000; 14 hash.Time = Math.floor(hash.Time / 1000000); 15 16 return this._super(typeHash, hash); 17 }, 18 });