[pve-devel] [PATCH manager 3/5] ui: ScheduleSimulator: split date and time into two columns

Dominik Csapak d.csapak at proxmox.com
Wed Jan 18 15:35:21 CET 2023


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

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/window/ScheduleSimulator.js | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/www/manager6/window/ScheduleSimulator.js b/www/manager6/window/ScheduleSimulator.js
index 20a20a6b8..6b02cbc98 100644
--- a/www/manager6/window/ScheduleSimulator.js
+++ b/www/manager6/window/ScheduleSimulator.js
@@ -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,9 +105,16 @@ 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,
 			},
 		    ],
-- 
2.30.2






More information about the pve-devel mailing list