From 6f463f2b02c253ec557b5c20360385a997634b7c Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Tue, 15 May 2018 14:26:59 +0200 Subject: [PATCH] Fix date-range filter for lower-bound and upper-bound and today filter. Now moving the timestamp value to the begin and end of the day instead of filter timestamp --- app/components/table-filters/date-range.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/table-filters/date-range.coffee b/app/components/table-filters/date-range.coffee index 9dddfc6..4fede15 100644 --- a/app/components/table-filters/date-range.coffee +++ b/app/components/table-filters/date-range.coffee @@ -42,6 +42,9 @@ export default Ember.Component.extend actions: set_filter: (key, value) -> + if value + edge = if key is 'upper_bound' then 'end' else 'start' + value["#{edge}Of"]('day') @set key, value @$('.dropdown').dropdown('hide') if key is 'upper_bound' @get('apply_filters')(@) if @get('eager_filter') @@ -52,10 +55,10 @@ export default Ember.Component.extend @get('apply_filters')(@) if @get('eager_filter') set_filter_today: -> - today = moment() + today = moment().startOf('day') @setProperties lower_bound: today - upper_bound: today + upper_bound: today.clone().endOf('day') @get('apply_filters')(@) @$('.dropdown').dropdown('hide')