mirror of https://github.com/apache/cloudstack.git
cloudStack 3.0 new UI - add a converter function to convert UTC date to local date.
This commit is contained in:
parent
c33db409db
commit
8377800460
|
|
@ -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 }
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in New Issue