Skip to content

Commit

Permalink
Fix initialization of date filter
Browse files Browse the repository at this point in the history
  • Loading branch information
gdaviet committed Dec 3, 2024
1 parent 2043a39 commit 74b09f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions collectives/static/js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ function filtersToQuery(filters) {
filterPayload.push({ field: 'title', type: 'like', value: filters.title })
}

if (filters.date) {
filterPayload.push({ field: 'end', type: 'like', value:
filters.date
})
}
filterPayload.push({ field: 'end', type: 'like', value:
filters.date || getServerLocalTime()
})

if (filters.leader) {
filterPayload.push({ field: 'leaders', type: 'like', value:
Expand Down
1 change: 1 addition & 0 deletions collectives/static/js/event/eventlist-filters.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default {
<p-datepicker
dateFormat="dd/mm/yy"
v-model="filters.date"
placeholder="Aujourd'hui"
></p-datepicker>
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion collectives/static/js/event/eventlist.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
activities: localStorage.getItem('eventlist-filters') ? JSON.parse(localStorage.getItem('eventlist-filters')).activities || [] : [],
eventTypes: localStorage.getItem('eventlist-filters') ? JSON.parse(localStorage.getItem('eventlist-filters')).eventTypes || [] : [],
eventTags: localStorage.getItem('eventlist-filters') ? JSON.parse(localStorage.getItem('eventlist-filters')).eventTags || [] : [],
date: moment().format("DD/MM/YYYY"),
date: null,
title: null,
leader: null,
displayCancelled: localStorage.getItem('eventlist-filters') ? JSON.parse(localStorage.getItem('eventlist-filters')).displayCancelled : false
Expand Down

0 comments on commit 74b09f3

Please sign in to comment.