Concrete5 5.6.3.1 oldest date is 2004 only [RESOLVED]

Permalink
If I use the built in form the oldest date that can be picked is 2004 only.

If I use Formidable, the oldest date that can be picked is 1970 only.

These problems did not exist before the upgrade

 
Mainio replied on at Permalink Reply
Mainio
Which version did you upgrade from?

I see the same in 5.6.1.2.
aleamio replied on at Permalink Reply
I upgraded from 5.6.2, I think. I am sure the problem was not there before with a different theme installed because I have a member who was born in 1950 and I got his membership with the correct date. But I just installed the latest one with the default theme, and the problem is there.
Mainio replied on at Permalink Reply
Mainio
OK, strange. Maybe these people have just written the date themselves and not selected it from the date picker?

The earliest commit in github (back from 2011) that has changed the jQuery datepicker shows its year range is +/- 10 years from the current date. It seems this setting has not changed since. It's the default "yearRange" option in jquery.ui.js for the datepicker.
JohntheFish replied on at Permalink Reply
JohntheFish
aleamio replied on at Permalink Reply
Actually they can't. In that version which the one born in 1950 submitted, he had to click on the year, month and date -- he was not allowed to write it.

Anybody from the core developer help fix this problem. Now all members born prior to 1970 can't their birth year correctly.
cmerritt replied on at Permalink Best Answer Reply
cmerritt
aleamio replied on at Permalink Reply
The post referred to by cmeritt worked but the line code number has changed.
http://www.concrete5.org/community/forums/customizing_c5/datepicker...

In the 5.6.3.1 open <site_root>/concrete/helpers/form/date_time.php. If you only see few lines of code it means you opened the wrong one. Look for the correct one -- it is there.

The original line 152 reads:
if ($calendarAutoStart) { 
         $html .= '<script type="text/javascript">$(function() { $("#' . $id . '_dt").datepicker({ dateFormat: \'' . DATE_APP_DATE_PICKER . '\', changeYear: true, showAnim: \'fadeIn\' }); });</script>';


Replaced with this one:
if ($calendarAutoStart) { 
         $html .= '<script type="text/javascript">$(function() { $("#' . $id . '_dt").datepicker({ dateFormat: \'' . DATE_APP_DATE_PICKER . '\', changeYear: true, showAnim: \'fadeIn\', yearRange: \'c-100:c+0\' }); });</script>';


Line 209 that reads:

if ($calendarAutoStart) { 
         $html .= '<script type="text/javascript">$(function() { $("#' . $id . '").datepicker({ dateFormat: \'' . DATE_APP_DATE_PICKER . '\', changeYear: true, showAnim: \'fadeIn\' }); });</script>';


Replace with the same code as done earlier:

if ($calendarAutoStart) { 
         $html .= '<script type="text/javascript">$(function() { $("#' . $id . '_dt").datepicker({ dateFormat: \'' . DATE_APP_DATE_PICKER . '\', changeYear: true, showAnim: \'fadeIn\', yearRange: \'c-100:c+0\' }); });</script>';