Skip to content

Commit

Permalink
Merge pull request #1117 from getredash/feature/params_ui
Browse files Browse the repository at this point in the history
Fix #1052: filter not working for date/time values
  • Loading branch information
arikfr authored Jun 14, 2016
2 parents df637e3 + a7af596 commit 4fabaae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rd_ui/app/scripts/services/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 4fabaae

Please sign in to comment.