I'm using a select list, with no timezone handling. Not using the required option. Not using the multiple option.

If I set the Years Back And Forward to -80:+1 (I am trying to capture birthdates), all is well on the first go-round--the year select list shows the range from 1928 to 2009. The problem arises when the user goes back to edit the form. If, for instance, they had selected 1945 as their DOB, the select list for year will now show the range from 1865 to 1946. In other words, the widget seems to take the selected year, instead of the current year, as the point of departure for its calculations.

Comments

zbricoleur’s picture

OK, no response...

I suppose there may be applications in which this behavior is the desired behavior, though I frankly can't imagine what they would be. In any case, for the benefit of others who may be having difficulties with this, I found that the behavior can be "normalized" by changing line 785 in date.inc from
$years_array = drupal_map_assoc(range($year - $years_back, $year + $years_forward));
to
$years_array = drupal_map_assoc(range(date_gmdate('Y', date_gmadj_zone(time())) - $years_back, date_gmdate('Y', date_gmadj_zone(time())) + $years_forward));

mavimo’s picture

The same problem with 2.0-rc1 anyone can help me to remove this "feature" ?

karens’s picture

Status: Active » Closed (won't fix)

@mavimo - if you're using version 2, don't post into version 1 reports. The versions are totally different. And this is *not* the same in version 2 where this has been completely re-worked so that years back and forward start from the current year and go back and forward far enough to be sure to pick up a previously-posted date.

I'm no longer updating the 5.1 version, I'm focusing all my effort at getting version 2 to a final release ASAP so it can become the official supported version. All new features, bug fixes, etc. are going into 5.2 (for Drupal 5) and 6.2 (for Drupal 6). If you have a working installation of 5.1, wait for a final release of 5.2. If you are having problems in 5.1, try the 5.2 version and help me get it polished.