cloudStack 3.0 new UI - add a converter function to convert UTC date to local date.

This commit is contained in:
Jessica Wang 2011-12-21 14:14:01 -08:00
parent c33db409db
commit 8377800460
2 changed files with 14 additions and 1 deletions

View File

@ -1528,7 +1528,7 @@
},
domain: { label: 'Domain', isEditable: false },
account: { label: 'Account', isEditable: false },
created: { label: 'Created', isEditable: false }
created: { label: 'Created', isEditable: false, converter: cloudStack.converters.toLocalDate }
}
],

View File

@ -204,6 +204,19 @@ cloudStack.converters = {
return (bytes / 1024 / 1024 / 1024 / 1024).toFixed(2) + " TB";
}
},
toLocalDate: function(UtcDate) {
var localDate = "";
if (UtcDate != null && UtcDate.length > 0) {
var disconnected = new Date();
disconnected.setISO8601(UtcDate);
if(g_timezoneoffset != null)
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
else
localDate = disconnected.getTimePlusTimezoneOffset(0);
}
return localDate;
},
toBooleanText: function(booleanValue) {
if(booleanValue == true)
return "Yes";