diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index c8fd2cc4..51f6ee4b 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -234,10 +234,7 @@ // Multi Instance settings data.manifest.multi_instance = data.manifest.multi_instance ? y18n.t('yes') : y18n.t('no'); - - // Installation date - var d = new Date(data.settings.install_time * 1000); - data.install_time = d.getDate() + '/' + (d.getMonth()+1) + '/' + d.getFullYear(); + data.install_time = new Date(data.settings.install_time * 1000); c.view('app/app_info', data); }); diff --git a/src/js/yunohost/controllers/backup.js b/src/js/yunohost/controllers/backup.js index 82b1e613..5c234462 100644 --- a/src/js/yunohost/controllers/backup.js +++ b/src/js/yunohost/controllers/backup.js @@ -136,6 +136,7 @@ data.name = c.params['archive']; data.system_parts = c.groupHooks(Object.keys(data['system'])); data.items = (data['hooks']!={} || data['apps']!=[]); + data.locale = y18n.locale c.view('backup/backup_info', data); }); }); @@ -153,6 +154,7 @@ data.archives2.unshift(info) }); data.archives = data.archives2; + data.locale = y18n.locale c.view('backup/backup_list', data); }); }); diff --git a/src/js/yunohost/controllers/services.js b/src/js/yunohost/controllers/services.js index 86e515fc..11ccbca0 100644 --- a/src/js/yunohost/controllers/services.js +++ b/src/js/yunohost/controllers/services.js @@ -22,6 +22,10 @@ // Translate status and loaded state v.status = y18n.t(v.status); v.loaded = y18n.t(v.loaded); + if (v.active_at == 'unknown') + { + delete v.active_at; + } data2.services.push(v); }); @@ -52,6 +56,10 @@ // Translate status and loaded state data2.service.active = y18n.t(data.active); data2.service.loaded = y18n.t(data.loaded); + if (data.active_at != 'unknown') + { + data2.service.active_at = data.active_at; + } store.clear('slide'); c.view('service/service_info', data2); }, 'GET'); diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index dd39d89c..d24566db 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -121,7 +121,7 @@ c.view('tools/tools_logs', { "data": data, - "locale": y18n.locale + "locale": y18n.locale }); }); }); @@ -134,12 +134,6 @@ c.api("/logs/display" + params, function(log) { if ('metadata' in log) { - if ('started_at' in log.metadata) { - log.metadata.started_at = Date.parse(log.metadata.started_at) - } - if ('ended_at' in log.metadata) { - log.metadata.ended_at = Date.parse(log.metadata.ended_at) - } if (!'env' in log.metadata && 'args' in log.metadata) { log.metadata.env = log.metadata.args } diff --git a/src/js/yunohost/main.js b/src/js/yunohost/main.js index 4ea32c8c..8ca70af2 100644 --- a/src/js/yunohost/main.js +++ b/src/js/yunohost/main.js @@ -26,10 +26,6 @@ Handlebars.registerHelper('humanTime', function(time) { return Math.round(time) + 's'; }); - Handlebars.registerHelper('timestampToDate', function(timestamp) { - var date = new Date(timestamp * 1000); - return date.toLocaleString(); - }); Handlebars.registerHelper('bitRate', function(bytes, time) { var sizes = ['b', 'Kb', 'Mb', 'Gb', 'Tb']; if (time === 0) return 'n/a'; diff --git a/src/views/app/app_appslists_info.ms b/src/views/app/app_appslists_info.ms index b1d30a52..4fa09040 100644 --- a/src/views/app/app_appslists_info.ms +++ b/src/views/app/app_appslists_info.ms @@ -18,7 +18,7 @@
{{t 'url'}}
{{appslist.url}}
{{t 'appslists_last_update'}}
-
{{timestampToDate appslist.lastUpdate}}
+
{{formatTime appslist.lastUpdate day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}
diff --git a/src/views/app/app_info.ms b/src/views/app/app_info.ms index eaa784b2..4df1e3dc 100644 --- a/src/views/app/app_info.ms +++ b/src/views/app/app_info.ms @@ -22,7 +22,7 @@
{{t 'multi_instance'}}
{{manifest.multi_instance}}
{{t 'install_time'}}
-
{{install_time}}
+
{{formatTime install_time day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}
{{t 'url'}}
https://{{settings.domain}}{{settings.path}}
diff --git a/src/views/backup/backup_info.ms b/src/views/backup/backup_info.ms index e8c2f9ac..a891612f 100644 --- a/src/views/backup/backup_info.ms +++ b/src/views/backup/backup_info.ms @@ -14,7 +14,7 @@
{{t 'id'}}
{{ name }}
-
{{t 'created_at'}}
{{ created_at }}
+
{{t 'created_at'}}
{{formatTime created_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}
{{t 'size'}}
{{ humanSize size}}
{{t 'path'}}
{{ path }}
diff --git a/src/views/backup/backup_list.ms b/src/views/backup/backup_list.ms index 67bf6b5d..38daf760 100644 --- a/src/views/backup/backup_list.ms +++ b/src/views/backup/backup_list.ms @@ -12,11 +12,12 @@
+{{#intl locales=locale}}
{{#each archives}} - + -

{{created_at}} {{name}} ({{humanSize size}})

+

{{formatRelative created_at}} {{name}} ({{humanSize size}})

{{path}}

{{/each}} @@ -28,6 +29,7 @@ {{/archives}}
+{{/intl}}