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
Comment #1
Lobidu commentedsubscribing.
Comment #2
Jerome F commentedEach 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
Comment #3
mrshanes commentedSame problems here. Happening for month also.
Comment #4
andreicio commentedFound 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.
Comment #5
Lobidu commentedThen could you just post what the line needs to look like so we could patch it by hand?
Comment #6
Jerome F commentedI can make the patch, if you could just post the code changes, please, it would be very nice.
Comment #7
Jerome F commentedThis 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.
Comment #8
Lobidu commentedThe Problem is still existing - I'm sorry to urge this, but I need the patch...
Comment #9
rvilarI have the same problem with views date filter.
Comment #10
hejeva commentedsubscribing.
Comment #11
mordonez commentedThe 7.x-2.x-dev branch fixes this problem
Comment #12
arlinsandbulte commentedFixed according to #11