Skip to content

Commit

Permalink
[SDPA-3310] Whatson event listing filtering by end date (#582)
Browse files Browse the repository at this point in the history
* [SDPA-3310] Added default filter value for end date as current date.
  • Loading branch information
MdNadimHossain authored Oct 30, 2019
1 parent fac5931 commit 4420cdc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/ripple-nuxt-tide/modules/event/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
</template>

<script>
import moment from 'moment'
import { RplDivider } from '@dpc-sdp/ripple-global'
import RplBreadcrumbs from '@dpc-sdp/ripple-breadcrumbs'
import { RplSearchForm, RplSearchResults } from '@dpc-sdp/ripple-search'
Expand All @@ -42,6 +40,9 @@ import { breadcrumbs as getBreadcrumbs } from '@dpc-sdp/ripple-nuxt-tide/lib/cor
import formData from './../formdata.js'
import { searchMixin } from '@dpc-sdp/ripple-nuxt-tide/modules/search'
// Setting Australia/Melbourne timezone
import moment from 'moment-timezone'
export default {
name: 'EventSearch',
components: {
Expand Down Expand Up @@ -106,6 +107,14 @@ export default {
type: 'date',
values: setFilterDate.endOf('day').toISOString()
}
} else {
const vic = moment.tz.setDefault('Australia/Melbourne')
const today = vic().startOf('day').toISOString()
filterValues['field_event_date_end_value'] = {
operator: 'gte',
type: 'date',
values: today
}
}
return filterValues
},
Expand Down

0 comments on commit 4420cdc

Please sign in to comment.