Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I have a date field as a select list with month and year. When the node is saved, the date is stored as a month earlier than entered. I thought that maybe the time zone settings were affecting things, but no matter what timezone options I choose, I can't seem to fix this problem.
BTW, it's great that date works in views now.
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedI just posted changes to cvs to clean up timezone handling, and these changes may (hopefully) also fix this problem. Can you try the latest cvs version and see if the problem remains?
Comment #2
patrickharris CreditAttribution: patrickharris commentedUnfortunately the changes don't seem to help. If I store a month and year, it is still saved as the previous month. I didn't reinstall the whole module though - should this be necessary because of the changes to date.install?
Comment #3
KarenS CreditAttribution: KarenS commentedI don't think the date install changes are a factor. I can't replicate your problem -- months are working fine for me -- so I need as much info as you can provide so I can duplicate your situation:
* what type of date are you creating (iso or timestamp)
* what widget are you using
* what granularity options did you choose
* what timezone handling did you select
* what timezone are you using for the above tz handling
* what date are you trying to create
* are you creating a date in a new node or using a node that existed before you started using the date module
* are you creating a new date or updating an existing date
Comment #4
KarenS CreditAttribution: KarenS commentedJust to be clear, you are using the latest version of date.inc, right? That's the one with the timezone changes.
Comment #5
patrickharris CreditAttribution: patrickharris commentedYes, the latest version. I'll uninstall date, remove the tables, reinstall, and see if the problem happens again.
Comment #6
patrickharris CreditAttribution: patrickharris commentedI'm choose "Fieldtype -> Date -> Select list". So the widget is a select list, granularity is year/month, all other options left alone. For timezone I tried about 6 different ones, and for time zone handling I experimented with "no handling" and "gmt".
Even on a fresh install of drupal, I still get this error, even with a brand new cck, new content, inserting a new date. If I update a node, and leave the value as is, it will always subtract one month. The dates I am trying to insert are "Jun 1928", but it happens the same for any date, even "Jun 2006".
Strange you can't duplicate it. Maybe it has something to do with php5 that I'm using?
Comment #7
KarenS CreditAttribution: KarenS commentedI'm not completely surprised I didn't run into this. With all the selectors, date types, granularity options, timezone options etc there are so many combinations I couldn't possibly test all of them :-)
Anyway, now I have something specific to test. I'll get back to you on this.
Comment #8
KarenS CreditAttribution: KarenS commentedOK, found the problem and I'm working on a fix. It is because you didn't provide a day. That is supposed to be allowable, but the program was trying to make it into a 'real' date and ended up creating a value for the last day of the previous month. Obviously I have to fix the logic :-)
I'll get something posted soon, hopefully.
Comment #9
KarenS CreditAttribution: KarenS commentedI just committed changes to the cvs version of date.inc that should fix this problem. Reopen if they don't work.
Comment #10
(not verified) CreditAttribution: commented