This is a carry over from #71131-45: Add popup calendar to date component.
is it possible to change the default year range of 3 years either side of the current year? The year fields already exist in the configuration for the date field but the popup seems to ignore them.
This is very similar to #301949: Add option to only allow dates in the past/future, only it just applies to years. It's also a trivial implementation, since we basically just need to allow a -/+ in front of the year and then assume that's a relative date instead of a hard date. It may also change my thinking on #301949: Add option to only allow dates in the past/future, since this would be easier generally to work with than my suggested approach over there, and it wouldn't have localization issues.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | webform_date_relative_years6.patch | 4.52 KB | quicksketch |
| #3 | webform_date_relative_years7.patch | 4.07 KB | quicksketch |
| #2 | webform_date_relative_years.patch | 4.48 KB | quicksketch |
Comments
Comment #1
quicksketchUpdating title, this only affects years, not actual dates that include a month and day.
Comment #2
quicksketchHere's the first take at this for the D6 version. It wasn't quite trivial, since as always we need to take into account timezones when dealing with anything that is relative. Fortunately we already had a nice routine for converting a relative date into month/day/years so I just moved it to a separate function and reused it here. Even though this is a bit edge-casy, it'd be rather frustrating to not have the option for the current year if you were submitting something on the evening of December 31st. ;-)
Comment #3
quicksketchPorted to Drupal 7 and fixed a help text typo from the last patch. I've committed these versions.