- Issue created by @VladimirAus
- πΊπΈUnited States apmsoonerI like this feature however, I don't think this is gonna work depending on date_filter module as there are implications around the field definition settings that aren't gonna match up with the sub-field settings. I'll look into just adding our own logic to bypass the need for that module. I think its always better if we can eliminate extra module dependencies. 
- πΊπΈUnited States apmsoonerSomewhat related... I created a custom element here https://git.drupalcode.org/project/custom_field/-/blob/3.1.x/src/Element... to handle the "Date only" type. Core's generic datetime element is not semantically correct the way its themed for this case, a random h4 replaces the label which is just wrong. We can incorporate the correct custom_field specific element here also into views and can pass in the storage settings through the custom_field.views.inc. Even the core patch that is referenced in that date_filter module implies the date type from the field storage settings which wouldn't exist in same place there for a sub-field. It shouldn't be a whole lot of effort I don't think to replicate what they did in that module. I'll see if i can get something up to test out soon. 
- π¦πΊAustralia VladimirAus Brisbane, AustraliaThanks @apmsooner, however your comment is not clear on what needs more work. 
 At the moment I have a clear issue where date fields are workingdate_filterbutcustom_fielddate fields are still plain text fields.My solution checks if the date_filteris enabled and complies with it's logic.
 If you have a specific testing scenario where it doesn't work, do let me know!
- πΊπΈUnited States apmsoonerLook here: https://git.drupalcode.org/project/date_filter/-/blob/1.0.x/src/Plugin/v... 
 The date type for custom_field is not at the parent field storage settings and also there are dependencies on the datetime field plugins which we don't need that module and should rely on our own subfield plugins. For these reasons, I think we just need to create our own custom plugin for views that does the same thing. Make sense?
- πΊπΈUnited States apmsoonerI think we can copy this file: https://git.drupalcode.org/project/date_filter/-/blob/1.0.x/src/Plugin/v... into ours and just change the namespace and then modify https://git.drupalcode.org/project/custom_field/-/blob/3.1.x/src/Plugin/... and then we won't need anything from that module or core datetime module. You can see how the settings are already currently passed into our class currently so we don't need to call a get to field storage in the same way. 
- πΊπΈUnited States apmsoonerYour patch was calling the DateTimestamp class from the module also. Shouldn't it have been the DateTime? I think thats maybe why its just working for you as is but i think the widget would/should be specific to the date type. 
- πΊπΈUnited States apmsoonerI'm taking this on in a different branch. I discovered there's some better ways to handle this that improve the UX considerably and account for the different operators better. It will take a little bit to get it complete for testing but the goal on my end is to convert even the configuration fields to a date type for easier default settings. The date elements are a bit messy in Core and have some bugs to fully support better alternatives but as I've already created a custom date element, I can extend that to account for the fixes so we can have a cleaner UX in the following ways: - If exposed filter is date only, strip out the extra theming wrapper so we get just a very simple date input without fieldsets and such
- If exposed filter is date + time, take advantage of the 'datetime-local' date element so we still get a simple input but better UX.
 There's a few core bugs related to 'datetime-local' that I can provide fixes for through my custom date element. All of this should lead to a better UX and be standardized across different admin themes. Stay tuned! 
- πΊπΈUnited States apmsoonerapmsooner β changed the visibility of the branch 3527922-implement-datefilter-integration to hidden. 
- πΊπΈUnited States apmsooner@vladimiraus & anyone else willing to help with this review: Please check out my branch and test. There is no connection with the date_filter module and therefore unnecessary. Everything is handled directly in custom_field and there is some pretty advanced logic and various fixes unaccounted for in Core that make date form fields and views filters way more functional and visually appealing. 
- 
            
              apmsooner β
             committed 8e3fd69a on 3.1.x
Issue #3527922 by apmsooner, vladimiraus: Views date filter + date... 
 
- 
            
              apmsooner β
             committed 8e3fd69a on 3.1.x