You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
something which really frustrates me in FormTools 3.0.20 is the fact that by default date pickers (Date field types) have some absurd date span. So I want to share with my own solution on how to set year range in your date picker and also ask if anyone knows a better solution. My solution is not the most elegant (because it uses window.onload but works nonetheless and let's the admin set the year range of date pickers to the desired value.
My solution goes like this:
install Custom Fields module (I tested it with version 2.1.0)
create a copy of the Date type
select the new field type, go to Settings and create a new setting for year range:
now go to Displaying > Edit field and modify it in the following way (first few lines set correct CSS classes so code from the original date type won't overwrite what we set up here and the last few lines actually update the date range of the date picker to the one we will set in the settings):
Hi,
something which really frustrates me in FormTools 3.0.20 is the fact that by default date pickers (
Date
field types) have some absurd date span. So I want to share with my own solution on how to set year range in your date picker and also ask if anyone knows a better solution. My solution is not the most elegant (because it useswindow.onload
but works nonetheless and let's the admin set the year range of date pickers to the desired value.My solution goes like this:
Date
typedate
type won't overwrite what we set up here and the last few lines actually update the date range of the date picker to the one we will set in the settings):$(".cf_datepicker").each(function() {
with$(".fixeddate").each(function() {
$(".cf_datetimepicker").each(function() {
with$(".fixeddatepicker").each(function() {
The text was updated successfully, but these errors were encountered: