]> git.proxmox.com Git - pve-manager.git/commitdiff
Add a new renderer for displaying dates in a human readable way
authorEmmanuel Kasper <e.kasper@proxmox.com>
Tue, 31 Jan 2017 15:48:49 +0000 (16:48 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Feb 2017 09:09:38 +0000 (10:09 +0100)
render_timestamp returns a Date as
"2017-01-31 16:17:33"
which is good for computers and column sorting but unfit
for human consumption

the new renderer added by this patch renders a Date as
"Tuesday 31 January 2017 16:18:08"

Day-month-year order is the most used ordering
in the world and also commonly used in the USA for
official documents.
source:
https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States
https://en.wikipedia.org/wiki/Date_format_by_country

www/manager6/Utils.js

index c05a137916987aedd4387fd35fa3980eda2aa250..148a1229958e70bb06451742b82e33afcbcbe365 100644 (file)
@@ -913,6 +913,10 @@ Ext.define('PVE.Utils', { utilities: {
        return Ext.Date.format(servertime, 'Y-m-d H:i:s');
     },
 
+    render_timestamp_human_readable: function(value) {
+       return Ext.Date.format(new Date(value * 1000), 'l d F Y H:i:s');
+    },
+
     calculate_mem_usage: function(data) {
        if (!Ext.isNumeric(data.mem) ||
            data.maxmem === 0 ||