Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request getredash#1117 from getredash/feature/params_ui
Browse files Browse the repository at this point in the history
Fix getredash#1052: filter not working for date/time values
  • Loading branch information
arikfr authored Jun 14, 2016
2 parents 705a6a3 + 0e55d59 commit 0819d75
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 0819d75

Please sign in to comment.