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);
},
renderTimestamp: function(value) {
renderDate: function(value) {
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) {
@ -100,11 +105,18 @@ Ext.define('PVE.window.ScheduleSimulator', {
height: 300,
columns: [
{
text: gettext('Local Time'),
renderer: 'renderTimestamp',
text: gettext('Date'),
renderer: 'renderDate',
dataIndex: 'timestamp',
flex: 1,
},
{
text: gettext('Time'),
renderer: 'renderTime',
dataIndex: 'timestamp',
align: 'right',
flex: 1,
},
],
store: {
fields: ['timestamp'],