Skip to content

Commit

Permalink
NYS-187: Remove usage of date range filter offsets to avoid issue whe…
Browse files Browse the repository at this point in the history
…re selected date returns results from prior date
  • Loading branch information
nathanielwoodland committed Nov 20, 2024
1 parent 0bcb6b6 commit 58d9fe6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/sync/views.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ui:
performance_statistics: false
preview_information: true
sql_query:
enabled: false
enabled: true
where: above
display_embed: false
always_live_preview: true
Expand Down
14 changes: 7 additions & 7 deletions config/sync/views.view.events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1528,8 +1528,8 @@ display:
value:
min: ''
max: ''
value: now
type: offset
value: ''
type: date
group: 1
exposed: true
expose:
Expand Down Expand Up @@ -3066,8 +3066,8 @@ display:
value:
min: ''
max: ''
value: now
type: offset
value: ''
type: date
group: 1
exposed: true
expose:
Expand Down Expand Up @@ -3379,10 +3379,10 @@ display:
plugin_id: datetime
operator: between
value:
min: now
max: now
min: ''
max: ''
value: ''
type: offset
type: date
group: 1
exposed: true
expose:
Expand Down
5 changes: 1 addition & 4 deletions web/modules/custom/nys_calendar/nys_calendar.module
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ function nys_calendar_form_views_exposed_form_alter(&$form, FormStateInterface $
if (!isset($default_date)) {
$default_date = date('Y') . date('-m-') . '01';
}
if (
!empty($form_state->getUserInput()['date'])
&& $form_state->getUserInput()['date'] === 'now'
) {
if (empty($form_state->getUserInput()['date'])) {
// Ensure default event day and month date filters are set on exposed
// form prior to user input.
$form['date']['#value'] = $default_date;
Expand Down

0 comments on commit 58d9fe6

Please sign in to comment.