Closed (fixed)
Project:
Better Exposed Filters
Version:
7.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2021 at 13:28 UTC
Updated:
13 Jun 2024 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Pooja Ganjage commentedHi,
Creating a patch for this issue.
Please review the patch.
Thanks.
Comment #3
Pooja Ganjage commentedComment #4
Pooja Ganjage commentedComment #5
heddn@Pooja Ganjage, thank you for your contributions, but we can't just remove the line in .info.yml. We need a replacement for what that dependency does pulled into and integrated into this module.
Comment #6
edmund.dunn commented@heddn Is there any reason we can't add a widget that uses browser native datepickers?
Comment #9
jeroentIMO we should use a native browser datepicker. Which #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter tries to add to Drupal core.
So for this module it's probably the easiest solution to get #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter in core and then fallback to the default filter.
I created a MR that removes all occurrences of jQuery UI Datepicker and an update hook that updates all filters that use jQuery UI datepicker to the default filter.
Comment #10
eojthebraveI like the approach here of removing jQuery UI datepicker in favor of the native browser one. And the code in the merge request works as advertised.
The one question I have is should this module do something like provide an option to covert the field to a #type => date element as a stop gap until #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter is resolved? On the one hand it is duplicate effort, on the other it means not having to wait on core to remove the functionality from this module without also being a step backwards in terms of what this module offers. I don't personally feel strongly one way or another but that's the one thing that made me hesitate when considering this solution.
If the answer is no we don't want to provide a stop-gap in this module then we can either commit this now and essentially remove the feature from the module. Or, we should mark this issue as blocked on the core issue.
Either way, thanks for getting things rolling here @JeroenT.
Comment #11
trackleft2I also like the idea of just using browser native form elements, and don't have a problem with the stop-gap option in #10.
This would also allow other modules to add javascript libraries for datepickers if they choose to.
Comment #12
anybodyThank you very much for this helpful approach. jQuery should be removed as all current browsers have type
type="date"support.I think it would make sense if maintainer(s) would have a look at #10 and decide which way to go.
Thanks all!
Setting back to NW for reroll. Please set NR afterwards.
Comment #14
grevil commentedDone.
Comment #15
anybodyThanks for rebasing / rerolling @Grevil! :)
Technical RTBC +1 for MR!17. Does what it should.
But #10 should be discussed. BTW in this webform issue, you can see how webform solves something similar: #3120543: Date field missing core/modernizr dependecy
Comment #16
super_romeo commentedMR !17 merge errorComment #17
grevil commentedMR needs to get rebased on current 5.x. Should we also cherry-pick the commit into 6.x? I guess that would make sense?
Comment #18
grevil commentedChanging version to 5.x for now, but my question still stands.
Comment #19
rcodinaI rerolled the MR 17 patch for 6.0.x. It failed for the composer.json and the README (change from txt to md extension).
Comment #20
rcodinaFixed overlapping of update functions.
Comment #21
grevil commentedWe shouldn't work with patches here, as we are already have implemented the changes in our issue fork. @rcodina could you update this issue fork's "3210945-remove-dependency-on" branch with your changes from #19 and #20? Or provide an interdiff between patch 19 and "3210945-remove-dependency-on"?
Comment #22
anybodyIt would still make a lot of sense to remove the jquery datepicker and replace it by the native HTML5 date selector. More lightweight, standard and less issues on our side.
@Grevil what was the reason to use 8.x-5.x instead of 6.x?
Re #10 regarding #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter I think that issue is PP-2 and will need loooooooong until being resolved. So we should do here, what we can and solve that part in a follow-up. jQuery datepicker is old, ugly and no more required here.
Issues like #3338846: Datepicker is displayed in wrong position when the page is scrolled will be gone after the change.
Anyone agrees we should finish this?
Comment #23
grevil commented@Anybody, honestly, I have no idea. Let's target 6.0.x!
Comment #25
grevil commentedAlright, I applied the rerolled patch by @rcodina on the newly created branch "3210945-remove-dependency-on-6.0.x".
Please review MR 39.
LGTM!
Comment #26
anybody@Grevil: Could you please test this in some combinations in the view and post a screenshot of the HTML5 datepicker shown? Also please try that it works in the expected formats, which means, ensure that the view returns the expected results from the date filter.
If you need further information, don't hesitate to contact me personally ;)
Comment #27
grevil commentedBack to "Needs work" there is no "datepicker" option.
Comment #28
grevil commentedOh my bad, didn't realise, that this patch requires the core patch provided in #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter!
It works alright. The date picker is way to specific. E.g. when filtering content based on the updated date, we also need to specify an exact time (with seconds), which won't do the trick here. But this should be discussed in the parent issue.
Here are some impressions:


But as the core patch is required, we should postpone this issue for now anyway.
POSTPONED on: #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter.
Comment #29
grevil commentedComment #30
grevil commentedComment #31
smustgrave commentedSo since core can be slower there anything we can do here instead to drop the crud of jquery.
Comment #32
smustgrave commentedActually lets do that. Just a simple filter for "Date" that uses a basic template OR we update the default filter that if it's a date field to set the type "#date"
Dealers choice
Only concern is if this could break existing sites maybe I start a 7.0.x branch for deprecations.
Comment #33
smustgrave commentedStarted a 7.0.x branch so this can continue.
Comment #34
smustgrave commentedSorry for the noise.
We have removed jquery_touch and have up for removal removal of jquery_slider
Leaves just this one but seems it's really blocked on a core issue that's stalled.
So lets handle ourselves here #3444650: Add support for input type "date". Then we update jquery plugins to use this and should be min disruption.
Comment #37
smustgrave commentedTried a different approach were we keep the filter but instead of relying on jquery it adds the attribute of type date.
Comment #38
finex commentedHi, will this feature will be backported on current stable 6.x version?
Comment #39
smustgrave commentedPlan is to merge this change into 6.0.x then in 7.0.x remove from the composer file.
Comment #44
smustgrave commentedBad form on my part I admit. But I went ahead and merged so that can get 7.0.x ready for a D11 release.
Comment #45
svendecabooterShouldn't the 'datepickers' library (js/bef_datepickers.js) also be removed within this change?
Or am I missing something?
Comment #46
smustgrave commentedNo the library is the same. It’s just now using non jquery plugins.
Comment #47
svendecabooterOk thanks for the clarification. Misinterpreted the change then.