From a7af596da01f49be33a4d92e884e174355c14cbe Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Jun 2016 10:58:33 +0300 Subject: [PATCH] Fix #1052: filter not working for date/time values --- rd_ui/app/scripts/services/resources.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rd_ui/app/scripts/services/resources.js b/rd_ui/app/scripts/services/resources.js index 3d160c999d..030e56abb4 100644 --- a/rd_ui/app/scripts/services/resources.js +++ b/rd_ui/app/scripts/services/resources.js @@ -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); });