Fix: string columns with dates failed to render.

This commit is contained in:
Arik Fraimovich 2015-05-19 21:43:50 +03:00
parent 6312f8738d
commit 30a89bfd2c

View File

@ -12,6 +12,8 @@
var columnTypes = {}; var columnTypes = {};
// TODO: we should stop manipulating incoming data, and switch to relaying on the column type set by the backend.
// This logic is prone to errors, and better be removed. Kept for now, for backward compatability.
_.each(this.query_result.data.rows, function (row) { _.each(this.query_result.data.rows, function (row) {
_.each(row, function (v, k) { _.each(row, function (v, k) {
if (angular.isNumber(v)) { if (angular.isNumber(v)) {
@ -30,7 +32,7 @@
_.each(this.query_result.data.columns, function(column) { _.each(this.query_result.data.columns, function(column) {
if (columnTypes[column.name]) { if (columnTypes[column.name]) {
if (column.type == null) { if (column.type == null || column.type == 'string') {
column.type = columnTypes[column.name]; column.type = columnTypes[column.name];
} }
} }