github.com/hspak/nomad@v0.7.2-0.20180309000617-bc4ae22a39a5/ui/app/serializers/task-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.Time % 1000000;
    10      hash.Time = Math.floor(hash.Time / 1000000);
    11  
    12      return this._super(typeHash, hash);
    13    },
    14  });