Steps to reproduce :
Localization setting is set on an European setting (Paris)

Create a date format with "Y" only : the result is "2011"
Then create a "year" date type using this date format "2011"

Create a date field with a select list widget.
Pick "year" as default display
Default value blank or now doesn't matter you get the same behavior.
Input format I tried "18/02/2011 21:52:34" and a custom "Y"
Years back and forward I use -6:+1 but I get the same with the default value.
Custom date parts within and above : same result.
Granularity "year"

Create a content with the date field
Select a date in the select list (eg. 2010), save and you'll see the selected year-1 as a result (one year earlier than the selected one) (eg. 2009).

Maybe related 6.x issue :
http://drupal.org/node/605824

Comments

Lobidu’s picture

subscribing.

Jerome F’s picture

Each time I edit a node with this field I have to remember to set it to the year +1 ! if not, when I save it's one year back each time...
For the moment I use : Text Field with custom input format instead of the select list widget

mrshanes’s picture

Same problems here. Happening for month also.

andreicio’s picture

Found the problem. Items that are not specifically given are initialized to empty string then converted to int, causing months or days to become 0, and cause the date to go back in time one step.
Values should be initialized in the date_api.module in the date_api directory in the module, function toISO(), line 497 in the file.
I'm not sure how to format patches, so I'd rather not post it.

Lobidu’s picture

Then could you just post what the line needs to look like so we could patch it by hand?

Jerome F’s picture

I can make the patch, if you could just post the code changes, please, it would be very nice.

Jerome F’s picture

This fix would be usefull for the select list widget. For the moment I changed my mind and use the date popup calendar which works fine.

Lobidu’s picture

The Problem is still existing - I'm sorry to urge this, but I need the patch...

rvilar’s picture

I have the same problem with views date filter.

hejeva’s picture

subscribing.

mordonez’s picture

The 7.x-2.x-dev branch fixes this problem

arlinsandbulte’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

Fixed according to #11

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.