diff --git a/app/components/explore/side-bar.js b/app/components/explore/side-bar.js index 27306421da6..c1a7b0b434e 100644 --- a/app/components/explore/side-bar.js +++ b/app/components/explore/side-bar.js @@ -168,6 +168,7 @@ export default class SideBar extends Component { break; case 'all_dates': + newStartDate = 'all_date'; break; case 'today': diff --git a/app/routes/explore.js b/app/routes/explore.js index 2b8c544336c..72088b41c78 100644 --- a/app/routes/explore.js +++ b/app/routes/explore.js @@ -223,20 +223,37 @@ export default class ExploreRoute extends Route { ] }); } else if (params.start_date) { - filterOptions.push({ - or: [ - { - name : 'starts-at', - op : 'ge', - val : params.start_date - }, - { - name : 'ends-at', - op : 'ge', - val : params.start_date - } - ] - }); + if (params.start_date === 'all_date') { + filterOptions.push({ + or: [ + { + name : 'starts-at', + op : 'le', + val : moment().toISOString() + }, + { + name : 'ends-at', + op : 'ge', + val : moment().toISOString() + } + ] + }); + } else { + filterOptions.push({ + or: [ + { + name : 'starts-at', + op : 'ge', + val : params.start_date + }, + { + name : 'ends-at', + op : 'ge', + val : params.start_date + } + ] + }); + } } else if (params.is_past) { filterOptions.push({ and: [ @@ -272,7 +289,7 @@ export default class ExploreRoute extends Route { return this.infinity.model('event', { include : 'event-topic,event-sub-topic,event-type', filter : filterOptions, - sort : params.is_past ? '-starts-at' : 'starts-at', + sort : params.is_past || (params.start_date === 'all_date') ? '-starts-at' : 'starts-at', perPage : 6, startingPage : 1, perPageParam : 'page[size]', diff --git a/app/templates/explore.hbs b/app/templates/explore.hbs index 2b979b4a72f..3b2675c69d2 100644 --- a/app/templates/explore.hbs +++ b/app/templates/explore.hbs @@ -23,7 +23,7 @@ {{/if}} - {{#if this.filters.start_date}} + {{#if (and this.filters.start_date (not-eq this.filters.start_date "all_date"))}}