fix(xo-server,xo-web/VM): hide creation date if not available (#3959)
Fixes #3953
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
|
||||
### Bug fixes
|
||||
|
||||
[Host] Fix multipathing status for XenServer < 7.5 [#3956](https://github.com/vatesfr/xen-orchestra/issues/3956) (PR [#3961](https://github.com/vatesfr/xen-orchestra/pull/3961))
|
||||
- [Host] Fix multipathing status for XenServer < 7.5 [#3956](https://github.com/vatesfr/xen-orchestra/issues/3956) (PR [#3961](https://github.com/vatesfr/xen-orchestra/pull/3961))
|
||||
- [Home/VM] Show creation date of the VM on if it available [#3953](https://github.com/vatesfr/xen-orchestra/issues/3953) (PR [#3959](https://github.com/vatesfr/xen-orchestra/pull/3959))
|
||||
|
||||
### Released packages
|
||||
|
||||
|
||||
@@ -54,12 +54,9 @@ function toTimestamp(date) {
|
||||
return timestamp
|
||||
}
|
||||
|
||||
const ms = parseDateTime(date)
|
||||
if (!ms) {
|
||||
return null
|
||||
}
|
||||
const ms = parseDateTime(date)?.getTime()
|
||||
|
||||
return Math.round(ms.getTime() / 1000)
|
||||
return ms === undefined || ms === 0 ? null : Math.round(ms / 1000)
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
@@ -116,18 +116,20 @@ export default connectStore(() => {
|
||||
<br />
|
||||
<Row className='text-xs-center'>
|
||||
<Col mediumSize={3}>
|
||||
<div className='text-xs-center'>
|
||||
{_('created', {
|
||||
date: (
|
||||
<FormattedDate
|
||||
day='2-digit'
|
||||
month='long'
|
||||
value={vm.installTime * 1000}
|
||||
year='numeric'
|
||||
/>
|
||||
),
|
||||
})}
|
||||
</div>
|
||||
{vm.installTime !== null && (
|
||||
<div className='text-xs-center'>
|
||||
{_('created', {
|
||||
date: (
|
||||
<FormattedDate
|
||||
day='2-digit'
|
||||
month='long'
|
||||
value={vm.installTime * 1000}
|
||||
year='numeric'
|
||||
/>
|
||||
),
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{vm.power_state === 'Running' ? (
|
||||
<div>
|
||||
<p className='text-xs-center'>
|
||||
|
||||
Reference in New Issue
Block a user