Closed olivierlambert closed 5 years ago
Use xapi-object-to-xo
's toTimestamp
.
Use
xapi-object-to-xo
'stoTimestamp
.
We already use it. https://github.com/vatesfr/xen-orchestra/blob/master/packages/xo-server/src/xapi-object-to-xo.js#L344
We have date like '19700101T00:00:00Z'
, parseDateTime
return 1970-01-01T00:00:00.000Z
so, ms.getTime()
return 0
Yes, when the date is '19700101T00:00:00Z'
, toTimestamp
should return null
instead of 0
and we shouldn't display anything in the UI.
const ms = parseDateTime(date).getTime()
if (ms === 0) {
return null
}
return Math.round(ms / 1000)
Instead of displaying T0 of UNIX timestamp into a date, we should hide the info if we don't have it.