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.

CommentFileSizeAuthor
#1 fix_date_handling.patch8.63 KBkarens

Comments

karens’s picture

StatusFileSize
new8.63 KB

OK, 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.

karens’s picture

Status: Active » Needs review
karens’s picture

Hmm, 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.

xamanu’s picture

Thank 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.

xamanu’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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