[pve-devel] [PATCH manager] Fix LXC Snapshots Edit Window timestamps

Emmanuel Kasper e.kasper at proxmox.com
Mon Jun 19 16:59:50 CEST 2017


API calls return dates in seconds where the JS Date() constructor
wants millisecond.

For the correct computation use render_timestamp_human_readable.

A similar fix was commited in aaa89d0b880ea9ab97927872e64d4427bbe2232d
for VMs but Containers missed the fix.
---
18th of January 1970 was nice but there is also life after.
 www/manager6/lxc/Snapshot.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/lxc/Snapshot.js b/www/manager6/lxc/Snapshot.js
index f09630c1..f5e1b242 100644
--- a/www/manager6/lxc/Snapshot.js
+++ b/www/manager6/lxc/Snapshot.js
@@ -86,6 +86,7 @@ Ext.define('PVE.window.LxcSnapshot', {
 	    items.push({
 		xtype: 'displayfield',
 		name: 'snaptime',
+		renderer: PVE.Utils.render_timestamp_human_readable,
 		fieldLabel: gettext('Timestamp')
 	    });
 	}
@@ -197,7 +198,7 @@ Ext.define('PVE.window.LxcSnapshot', {
 		summarystore.resumeEvents();
 		summarystore.fireEvent('refresh', summarystore);
 
-		form.findField('snaptime').setValue(new Date(data.snaptime));
+		form.findField('snaptime').setValue(data.snaptime);
 		form.findField('description').setValue(data.description);
 	    }
 	});
-- 
2.11.0





More information about the pve-devel mailing list