diff --git a/rd_ui/app/scripts/ng_smart_table.js b/rd_ui/app/scripts/ng_smart_table.js index 434b65758c..9bc7a0a94b 100644 --- a/rd_ui/app/scripts/ng_smart_table.js +++ b/rd_ui/app/scripts/ng_smart_table.js @@ -91,7 +91,7 @@ //insert columns from column config //TODO add a way to clean all columns - scope.$watch('columnCollection', function (oldValue, newValue) { + scope.$watchCollection('columnCollection', function (oldValue, newValue) { if (scope.columnCollection) { scope.columns.length = 0; for (var i = 0, l = scope.columnCollection.length; i < l; i++) { diff --git a/rd_ui/app/scripts/visualizations/table.js b/rd_ui/app/scripts/visualizations/table.js index 003069f2f0..e843c9088c 100644 --- a/rd_ui/app/scripts/visualizations/table.js +++ b/rd_ui/app/scripts/visualizations/table.js @@ -78,14 +78,14 @@ }; } else if (columnType === 'date') { columnDefinition.formatFunction = function (value) { - if (value) { + if (value && moment.isMoment(value)) { return value.toDate().toLocaleDateString(); } return value; }; } else if (columnType === 'datetime') { columnDefinition.formatFunction = function (value) { - if (value) { + if (value && moment.isMoment(value)) { return value.toDate().toLocaleString(); } return value;