Fix #234: when converting value to moment, also set the column type

This commit is contained in:
Arik Fraimovich
2014-07-05 11:35:10 +03:00
parent 9b5d43067a
commit 8c59386dc9
2 changed files with 17 additions and 19 deletions

View File

@@ -63,23 +63,6 @@
var columnType = columns[i].type;
if (!columnType) {
var rawData = $scope.queryResult.getRawData();
if (rawData.length > 0) {
var exampleData = rawData[0][col];
if (angular.isNumber(exampleData)) {
columnType = 'float';
} else if (moment.isMoment(exampleData)) {
if (exampleData._i.match(/^\d{4}-\d{2}-\d{2}T/)) {
columnType = 'datetime';
} else {
columnType = 'date';
}
}
}
}
if (columnType === 'integer') {
columnDefinition.formatFunction = 'number';
columnDefinition.formatParameter = 0;