Merge pull request #1117 from getredash/feature/params_ui

Fix #1052: filter not working for date/time values
This commit is contained in:
Arik Fraimovich
2016-06-14 11:02:02 +03:00
committed by GitHub

View File

@@ -174,9 +174,14 @@
};
return (memo && _.some(filter.current, function(v) {
// We compare with either the value or the String representation of the value,
// because Select2 casts true/false to "true"/"false".
return v == row[filter.name] || String(row[filter.name]) == v
var value = row[filter.name];
if (moment.isMoment(value)) {
return value.isSame(v);
} else {
// We compare with either the value or the String representation of the value,
// because Select2 casts true/false to "true"/"false".
return (v == value || String(value) == v);
}
}));
}, true);
});