diff --git a/app/assets/javascripts/app/manage/statistics_filter.js.coffee b/app/assets/javascripts/app/manage/statistics_filter.js.coffee index 5a45f4914..fd2181c9a 100644 --- a/app/assets/javascripts/app/manage/statistics_filter.js.coffee +++ b/app/assets/javascripts/app/manage/statistics_filter.js.coffee @@ -14,9 +14,8 @@ class mconf.StatisticsFilter $('.datetime-picker-input').on 'change', -> checkDate() -isAllSelected = -> - selected = $('.starts-at-wrapper .btn.active').data('attr-value') - selected is 0 + start.on 'change', -> + limitMinimumEnd() filterByDate = (el) -> if el @@ -24,11 +23,14 @@ filterByDate = (el) -> else selected = $('.starts-at-wrapper .btn.active').data('attr-value') +limitMinimumEnd = -> + startDate = statistics_starts_on_time.value + + if startDate != "" + mconf.DateTimeInput.setStartDate($(statistics_ends_on_time), new Date(startDate)) + checkDate = -> startDate = statistics_starts_on_time.value endDate = statistics_ends_on_time.value $(submitSelector).removeAttr('disabled') - - if startDate != "" - mconf.DateTimeInput.setStartDate($(statistics_ends_on_time), new Date(startDate))