mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 16:14:01 +02:00
Expose 2 new columns: Creation and Modification Date
Expose 2 new optional columns: - Creation Date - Modification Date To address Issue #673
This commit is contained in:
parent
8cc9c19b40
commit
7c4115c4cf
1 changed files with 18 additions and 2 deletions
|
@ -190,7 +190,7 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
|||
PROFILE("getMultipleProperties", function () {
|
||||
var multipleProperties = Entities.getMultipleEntityProperties(ids, ['position', 'name', 'type', 'locked',
|
||||
'visible', 'renderInfo', 'modelURL', 'materialURL', 'imageURL', 'script', 'certificateID',
|
||||
'skybox.url', 'ambientLight.url']);
|
||||
'skybox.url', 'ambientLight.url', 'created', 'lastEdited']);
|
||||
for (var i = 0; i < multipleProperties.length; i++) {
|
||||
var properties = multipleProperties[i];
|
||||
|
||||
|
@ -234,7 +234,9 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
|||
drawCalls: (properties.renderInfo !== undefined ?
|
||||
valueIfDefined(properties.renderInfo.drawCalls) : ""),
|
||||
hasScript: properties.script !== "",
|
||||
parentState: parentState
|
||||
parentState: parentState,
|
||||
created: formatToStringDateTime(properties.created),
|
||||
lastEdited: formatToStringDateTime(properties.lastEdited),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -254,6 +256,20 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
|||
});
|
||||
};
|
||||
|
||||
function formatToStringDateTime(timestamp) {
|
||||
var d = new Date(Math.floor(timestamp/1000));
|
||||
var dateTime = d.getUTCFullYear() + "-" + zeroPad((d.getUTCMonth() + 1), 2) + "-" + zeroPad(d.getUTCDate(), 2);
|
||||
dateTime = dateTime + " " + zeroPad(d.getUTCHours(),2) + ":" + zeroPad(d.getUTCMinutes(), 2) + ":" + zeroPad(d.getUTCSeconds(), 2);
|
||||
dateTime = dateTime + "." + zeroPad(d.getUTCMilliseconds(), 3);
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
function zeroPad(num, size) {
|
||||
num = num.toString();
|
||||
while (num.length < size) num = "0" + num;
|
||||
return num;
|
||||
}
|
||||
|
||||
function onFileSaveChanged(filename) {
|
||||
Window.saveFileChanged.disconnect(onFileSaveChanged);
|
||||
if (filename !== "") {
|
||||
|
|
Loading…
Reference in a new issue