ui: ScheduleSimulator: split date and time into two columns

and align the time right. This makes it easier to compare times

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-01-18 15:35:21 +01:00 committed by Thomas Lamprecht
parent cc911f63aa
commit 92df2742f5

View File

@ -32,9 +32,14 @@ Ext.define('PVE.window.ScheduleSimulator', {
this.lookup('simulateBtn').setDisabled(!value); this.lookup('simulateBtn').setDisabled(!value);
}, },
renderTimestamp: function(value) { renderDate: function(value) {
let date = new Date(value*1000); let date = new Date(value*1000);
return date.toLocaleString(); return date.toLocaleDateString();
},
renderTime: function(value) {
let date = new Date(value*1000);
return date.toLocaleTimeString();
}, },
init: function(view) { init: function(view) {
@ -100,11 +105,18 @@ Ext.define('PVE.window.ScheduleSimulator', {
height: 300, height: 300,
columns: [ columns: [
{ {
text: gettext('Local Time'), text: gettext('Date'),
renderer: 'renderTimestamp', renderer: 'renderDate',
dataIndex: 'timestamp', dataIndex: 'timestamp',
flex: 1, flex: 1,
}, },
{
text: gettext('Time'),
renderer: 'renderTime',
dataIndex: 'timestamp',
align: 'right',
flex: 1,
},
], ],
store: { store: {
fields: ['timestamp'], fields: ['timestamp'],