DUPLICATE ticket - https://www.drupal.org/project/drupal/issues/2840220
I think it would be very useful if you could specify the range of years which appears in the year options part of the new date form element.
I've created a patch which adds #start_year and #end_year properties allowing you to easily specify a desired range.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | patch-error.png | 15.17 KB | vikashsoni |
| expand_date_start_and_end_years.patch | 1.48 KB | kumo |
Comments
Comment #1
sammys commented+1
Bumping this up as it's easy to patch in and test.
Comment #2
Crell commentedThis now belongs to CVS.
I like the concept, and worked for me perfectly when I tested it on the daily module. I don't see any bugs, and it's a nice feature to have. +1.
Comment #3
drummI think the best place for this would better be implemented as a defualt value in system_elements().
Comment #4
catchComment #5
Jaza commentedThe respective start and end years '1900' and '2050' are still hard-coded into expand_date(). Ergo, this patch is still needed. Bumping.
Comment #6
valthebaldThat looks like useful feature, and good for novices too
Comment #7
xjmActually, given how far it is past the feature and API freeze deadlines, this is for 9.x at this point (or maybe a minor version of 8.x, but in that case we can move it back after 8.0 is released). This issue might not even be relevant anymore and the original patch is certainly not useful. :)
Comment #8
catchComment #19
quietone commentedI don't see any reason for this to be postponed and datetime.module seems a better fit (I hope).
Comment #20
aritrika.d commentedComment #22
vikashsoni commentedPatch not working giving error while applying in drupal-9.3.x-dev
Comment #23
quietone commented@vikashsoni thank you for looking into this issue but there is never a need to show screenshots of patch applications. If you discover a patch does not apply it is best to leave a comment explaining what you did and what version of Drupal you were testing with. And then if a reroll is needed add the tag, 'Needs reroll'. Therefor, credit has been removed per How is credit granted for Drupal core issues.
Comment #27
jaime@gingerrobot.com commentedComment #28
jaime@gingerrobot.com commentedThis feature should be covered by https://www.drupal.org/project/drupal/issues/2840220