Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
better_exposed_filters
Commits
d4d05dca
Commit
d4d05dca
authored
Sep 15, 2020
by
Neslee
Browse files
Issue #3158588 by jberube, Etroid: Autocomplete suggestions cover datepicker
parent
c90fbfac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/Plugin/better_exposed_filters/filter/DatePickers.php
src/Plugin/better_exposed_filters/filter/DatePickers.php
+6
-0
No files found.
src/Plugin/better_exposed_filters/filter/DatePickers.php
View file @
d4d05dca
...
...
@@ -52,11 +52,13 @@ class DatePickers extends FilterWidgetBase {
&&
'date_text'
==
$form
[
$field_id
][
'min'
][
'#type'
]
&&
'date_text'
==
$form
[
$field_id
][
'max'
][
'#type'
];
// @todo lots of repetition of code. Let's re-organize and clean up.
if
(
$is_single_date
||
$is_double_date
)
{
if
(
isset
(
$form
[
$field_id
][
'value'
]))
{
$format
=
$form
[
$field_id
][
'value'
][
'#date_format'
];
$form
[
$field_id
][
'value'
][
'#attributes'
][
'class'
][]
=
'bef-datepicker'
;
$form
[
$field_id
][
'value'
][
'#attributes'
][
'type'
]
=
'date'
;
$form
[
$field_id
][
'value'
][
'#attributes'
][
'autocomplete'
]
=
'off'
;
}
else
{
// Both min and max share the same format.
...
...
@@ -65,6 +67,8 @@ class DatePickers extends FilterWidgetBase {
$form
[
$field_id
][
'max'
][
'#attributes'
][
'class'
][]
=
'bef-datepicker'
;
$form
[
$field_id
][
'min'
][
'#attributes'
][
'type'
]
=
'date'
;
$form
[
$field_id
][
'max'
][
'#attributes'
][
'type'
]
=
'date'
;
$form
[
$field_id
][
'min'
][
'#attributes'
][
'autocomplete'
]
=
'off'
;
$form
[
$field_id
][
'max'
][
'#attributes'
][
'autocomplete'
]
=
'off'
;
}
// Convert Date API format to jQuery UI date format.
...
...
@@ -84,12 +88,14 @@ class DatePickers extends FilterWidgetBase {
if
(
isset
(
$form
[
$field_id
][
$field
]))
{
$form
[
$field_id
][
$field
][
'#attributes'
][
'class'
][]
=
'bef-datepicker'
;
$form
[
$field_id
][
$field
][
'#attributes'
][
'type'
]
=
'date'
;
$form
[
$field_id
][
$field
][
'#attributes'
][
'autocomplete'
]
=
'off'
;
}
}
}
else
{
$form
[
$field_id
][
'#attributes'
][
'class'
][]
=
'bef-datepicker'
;
$form
[
$field_id
][
'#attributes'
][
'type'
]
=
'date'
;
$form
[
$field_id
][
'#attributes'
][
'autocomplete'
]
=
'off'
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment