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

This commit is contained in:
2018-05-15 14:26:59 +02:00
parent e20d5e9389
commit 6f463f2b02
@@ -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')