Closed (fixed)
Project:
Timeline
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2011 at 14:04 UTC
Updated:
9 Jul 2011 at 20:31 UTC
Jump to comment: Most recent file
There are numerous problems in the date handling in the D7 version. One is that the core values for 'timezone' are no longer integers, they are now timezone names. So none of the timezone values are getting adjusted correctly.
The other is that the Date API no longer uses the date_convert() function, you create a DateObject() like $date = new DateObject(), manipulate it as needed, and then display it using $date->format().
I'm working up a patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fix_date_handling.patch | 8.63 KB | karens |
Comments
Comment #1
karens commentedOK, here it is. I made the convertToTimestamp() and convertToGregorian() functions into public functions so we can re-use them everywhere so all the logic is in one place instead of scattered all over.
Then I was able to use the PHP 5.2 date functions to more cleanly create and handle the dates, using the name of the timezone, which is the value we now have to work with. Since D7 requires PHP 5.2 we can use these functions safely. Since you don't have a dependency on Date API, I fixed it without using Date API. If you had a dependency I would fix it differently. But I think that the functions you need will work without Date API.
So here is a patch to fix the date handling.
Comment #2
karens commentedComment #3
karens commentedHmm, I suppose we should also rename those functions to prefix the function name with timeline_, to avoid potential clashes. I didn't take time to do that, but it would be a good idea.
Comment #4
xamanu commentedThank you Karen. I just committed (and pushed) this and changed the function names as you suggested. Anyway I think that this might go back into the part of timeline creation if we think about #1192828: plugable library support . But this could and should be addressed within this issue and is some future stuff.
Comment #5
xamanu commented