ui: factor out render_datetime_utc
will be reused in the next patch Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
11
www/Utils.js
11
www/Utils.js
@ -25,6 +25,17 @@ Ext.define('PBS.Utils', {
|
||||
return path.indexOf(PBS.Utils.dataStorePrefix) === 0;
|
||||
},
|
||||
|
||||
render_datetime_utc: function(datetime) {
|
||||
let pad = (number) => number < 10 ? '0' + number : number;
|
||||
return datetime.getUTCFullYear() +
|
||||
'-' + pad(datetime.getUTCMonth() + 1) +
|
||||
'-' + pad(datetime.getUTCDate()) +
|
||||
'T' + pad(datetime.getUTCHours()) +
|
||||
':' + pad(datetime.getUTCMinutes()) +
|
||||
':' + pad(datetime.getUTCSeconds()) +
|
||||
'Z';
|
||||
},
|
||||
|
||||
render_datastore_worker_id: function(id, what) {
|
||||
const result = id.match(/^(\S+)_([^_\s]+)_([^_\s]+)$/);
|
||||
if (result) {
|
||||
|
Reference in New Issue
Block a user