I'm using a date CCK field to store a date and time with a configurable time zone.
If I save a node with a single date, then the date saves to the CCK field's table in the database with the offset and offset2 values set correctly.
e.g, with timezone set to America/Vancouver, I get offset = -25200
If I save a node with the same date and time, but have the event repeat every week, then no offset nor offset2 value is saved in the database.
e.g., with timezone set to America/Vancouver, I get offset = 0
This causes the date and time to appear incorrectly on the node's page. It appears as 7 hours ahead because the timezone offset is not being applied.
How can I get the offset value to save to the database when there are multiple dates?
Comment | File | Size | Author |
---|---|---|---|
#4 | offset_missing_repeating_dates-1317586-4.patch | 1.53 KB | srees |
Comments
Comment #1
endless_wander CreditAttribution: endless_wander commentedIn date.module, in the date_formatter_process() function, if I log the following line, the correct offset values are there:
$dates[$processed]['local']['offset'] = date_offset_get($date);
But this is never saved to the database when repeat dates are entered. Still investigating.
Comment #2
endless_wander CreditAttribution: endless_wander commentedI solved my problem of the wrong time appearing in the node display by using the date_offset_get() function to add on the appropriate offset to my times.
Still, this seems like a bug that the offset and offset2 values are not set in the database.
Comment #3
needle CreditAttribution: needle commentedEncountering the same issue. Thanks for posting a workaround, clavigne, however I use `variable_get('date_default_timezone', 0)` to get Drupal's setting instead of the server's.
Comment #4
srees CreditAttribution: srees commentedI've written a patch to fix this. It was a logic error in date_repeat.inc
I've attached a patch for testing by the community.
Comment #7
srees CreditAttribution: srees commented4: offset_missing_repeating_dates-1317586-4.patch queued for re-testing.
Comment #9
srees CreditAttribution: srees commentedComment #10
srees CreditAttribution: srees commented4: offset_missing_repeating_dates-1317586-4.patch queued for re-testing.
Comment #11
DamienMcKennaI'm sorry but the Drupal 6 version of this module is no longer supported. That said, I appreciate the time you spent on this.