Minor adjustments

Minor adjustments
This commit is contained in:
Alezia Kurdis 2020-10-25 14:25:19 -04:00 committed by GitHub
parent a264fc358e
commit 1e51df0843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,7 +236,7 @@ EntityListTool = function(shouldUseEditTabletApp) {
hasScript: properties.script !== "",
parentState: parentState,
created: formatToStringDateTime(properties.created),
lastEdited: formatToStringDateTime(properties.lastEdited),
lastEdited: formatToStringDateTime(properties.lastEdited)
});
}
}
@ -259,14 +259,16 @@ 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.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;
while (num.length < size) {
num = "0" + num;
}
return num;
}