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