Fix translation for graph time selection and display

This commit is contained in:
Johannes Zellner
2021-04-01 16:05:13 +02:00
parent 850ff87849
commit 465fc427d6
13 changed files with 29 additions and 28 deletions

View File

@@ -100,6 +100,18 @@ angular.module('Application').filter('prettyDiskSize', function () {
return function (size, fallback) { return prettyByteSize(size, fallback) || 'Not available yet'; };
});
angular.module('Application').filter('trKeyFromPeriod', function () {
return function (period) {
if (period === 6) return 'app.graphs.period.6h';
if (period === 12) return 'app.graphs.period.12h';
if (period === 24) return 'app.graphs.period.24h';
if (period === 24*7) return 'app.graphs.period.7d';
if (period === 24*30) return 'app.graphs.period.30d';
return '';
};
});
angular.module('Application').filter('prettyDate', function () {
// http://ejohn.org/files/pretty.js
return function prettyDate(utc) {