Commit 52d5e474 by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2728: UI renders integer attribute values as date -…

ATLAS-2728: UI renders integer attribute values as date - kafka_topic.retentiontimeLocalInHrs, kafka_topic.retentiontimeNationalInHrs Signed-off-by: 's avatarMadhan Neethiraj <madhan@apache.org>
parent 72cc566a
...@@ -202,7 +202,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -202,7 +202,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var defEntity = _.find(attributeDefs, { name: key }); var defEntity = _.find(attributeDefs, { name: key });
if (defEntity && defEntity.typeName) { if (defEntity && defEntity.typeName) {
var defEntityType = defEntity.typeName.toLocaleLowerCase(); var defEntityType = defEntity.typeName.toLocaleLowerCase();
if (defEntityType === 'date' || defEntityType === 'time') { if (defEntityType === 'date') {
keyValue = new Date(keyValue); keyValue = new Date(keyValue);
} else if (_.isObject(keyValue)) { } else if (_.isObject(keyValue)) {
keyValue = extractObject(keyValue); keyValue = extractObject(keyValue);
...@@ -219,12 +219,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -219,12 +219,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
val = '<a target="_blank" class="blue-link" href="' + keyValue + '">' + keyValue + '</a>'; val = '<a target="_blank" class="blue-link" href="' + keyValue + '">' + keyValue + '</a>';
} else if (key === 'guid' || key === "__guid") { } else if (key === 'guid' || key === "__guid") {
val = '<a title="' + key + '" href="#!/detailPage/' + keyValue + '">' + keyValue + '</a>'; val = '<a title="' + key + '" href="#!/detailPage/' + keyValue + '">' + keyValue + '</a>';
} else if (key.toLocaleLowerCase().indexOf("time") !== -1 || key.toLocaleLowerCase().indexOf("date") !== -1) {
val = new Date(keyValue);
if (isNaN(val.getTime())) {
val = _.escape(keyValue);
}
} else { } else {
val = _.escape(keyValue); val = _.escape(keyValue);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment