This is an automated email from the ASF dual-hosted git repository.

ppawar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new c78f3cb1a ATLAS-4736:Audit tab reporting a date of 1970 in a few 
properties.
c78f3cb1a is described below

commit c78f3cb1af4f5b15bbd092d45d0cb7b6cc763843
Author: Prasad Pawar <prasad.pa...@freestoneinfotech.com>
AuthorDate: Fri Mar 24 12:53:29 2023 +0530

    ATLAS-4736:Audit tab reporting a date of 1970 in a few properties.
    
    Signed-off-by: Prasad Pawar <prasad.pa...@freestoneinfotech.com>
---
 dashboardv2/public/js/utils/CommonViewFunction.js               | 2 +-
 dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js | 8 +-------
 dashboardv3/public/js/utils/CommonViewFunction.js               | 2 +-
 dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js | 8 +-------
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index b1c15507f..bb545057d 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -290,7 +290,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
             if (defEntity && defEntity.typeName) {
                 var defEntityType = defEntity.typeName.toLocaleLowerCase();
                 if (defEntityType === 'date') {
-                    keyValue = keyValue > 0 ? Utils.formatDate({ date: 
keyValue }) : null;
+                    keyValue = moment(keyValue)._isValid ? Utils.formatDate({ 
date: keyValue }) : null;
                 } else if (_.isObject(keyValue)) {
                     keyValue = extractObject({ "keyValue": keyValue, "key": 
key, 'defEntity': defEntity });
                 }
diff --git a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js 
b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
index 20eac0650..bd4d64813 100644
--- a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -92,13 +92,7 @@ define(['require',
             createTableWithValues: function(tableDetails) {
                 var attrTable = CommonViewFunction.propertyTable({
                     scope: this,
-                    getValue: function(val, key) {
-                        if (key && key.toLowerCase().indexOf("time") > 0) {
-                            return Utils.formatDate({ date: val });
-                        } else {
-                            return val;
-                        }
-                    },
+                    attributeDefs: this.attributeDefs,
                     valueObject: tableDetails
                 });
                 return attrTable;
diff --git a/dashboardv3/public/js/utils/CommonViewFunction.js 
b/dashboardv3/public/js/utils/CommonViewFunction.js
index 636bdae28..452595d7f 100644
--- a/dashboardv3/public/js/utils/CommonViewFunction.js
+++ b/dashboardv3/public/js/utils/CommonViewFunction.js
@@ -290,7 +290,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
             if (defEntity && defEntity.typeName) {
                 var defEntityType = defEntity.typeName.toLocaleLowerCase();
                 if (defEntityType === 'date') {
-                    keyValue = keyValue > 0 ? Utils.formatDate({ date: 
keyValue }) : null;
+                    keyValue = moment(keyValue)._isValid ? Utils.formatDate({ 
date: keyValue }) : null;
                 } else if (_.isObject(keyValue)) {
                     keyValue = extractObject({ "keyValue": keyValue, "key": 
key, 'defEntity': defEntity });
                 }
diff --git a/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js 
b/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
index 0e2ade3fd..6988c34a3 100644
--- a/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -93,13 +93,7 @@ define(['require',
             createTableWithValues: function(tableDetails) {
                 var attrTable = CommonViewFunction.propertyTable({
                     scope: this,
-                    getValue: function(val, key) {
-                        if (key && key.toLowerCase().indexOf("time") > 0) {
-                            return Utils.formatDate({ date: val });
-                        } else {
-                            return val;
-                        }
-                    },
+                    attributeDefs: this.attributeDefs,
                     valueObject: tableDetails
                 });
                 return attrTable;

Reply via email to