Problem/Motivation
I would like to be able to disable specific dates in the jquery ui date picker.
It is already possible to disable specific days of the week. but not a list of arbitrary dates.
Proposed resolution
Update webform_jqueryui_datepicker.element.js to support a data-disabled-dates attribute.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform-jqueryui-datepicker-disable-dates-3492178-0.patch | 1.32 KB | dahousecat |
| #5 | 3492178-5.patch | 814 bytes | jrockowitz |
Comments
Comment #2
dahousecat commentedComment #3
dahousecat commentedComment #4
dahousecat commentedExample data-disabled-dates attribute:
data-disabled-dates="2024-12-17,2024-12-18,2024-12-19,2024-12-25,2024-12-26"Comment #5
jrockowitz commentedI would not want to support individual options; instead, I'd like to make it easier for people (aka developers) to define custom options to a webform element.
Attached is a POC (untested) approach that adds support to
data-options="{}"thedata-optionswould always be applied last. This could become a universal solution that allows developers to define element-specific custom JS options.The approach you could take would be something like...
data-options="{'beforeShowDay': my_custom_before_show_data'}"New features will only be added to 6.3.x
Comment #6
dahousecat commentedI think that approach sounds very wise.
The patch I have will solve my use case for now, but once this feature gets added I can delete my patch :)
Comment #7
dahousecat commentedComment #8
jrockowitz commentedLet's leave this open because I think #5 needs to happen for most webform element libraries.
Comment #9
cilefen commentedComment #10
liam morlandComment #11
jrockowitz commented@see #3493832: Allow custom data-options to be added to elements JavaScript options