[pve-devel] [PATCH manager 3/3] translate weekdays in backupgrid

Dominik Csapak d.csapak at proxmox.com
Wed Apr 6 14:34:57 CEST 2016


previously we displayed always something like: "mon,tue,wed"
now we use the full name of the day and the correct translation
making it (eg in german):
"Montag, Dienstag, Mittwoch"

i did not to choose the first 3 letters, because we cannot be
sure they are unique for all workdays in every language

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/Backup.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 32abc89..11e9584 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -430,7 +430,15 @@ Ext.define('PVE.dc.BackupView', {
 		    header: gettext('Day of week'),
 		    width: 200,
 		    sortable: false,
-		    dataIndex: 'dow'
+		    dataIndex: 'dow',
+		    renderer: function(val) {
+			var dows = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
+			var selected = [];
+			val.split(',').forEach(function(day){
+			    selected.push(Ext.Date.dayNames[dows.indexOf(day)]);
+			});
+			return selected.join(', ');
+		    }
 		},
 		{
 		    header: gettext('Start Time'),
-- 
2.1.4





More information about the pve-devel mailing list