ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Date / Time issues on date listing pages

October 27, 2011 11:45am

Subscribe [4]
  • #1 / Oct 27, 2011 11:45am

    fostermade

    97 posts

    Hello,

    We have an EE 2.1.3 20101220 site in development and are having an issue with entries being displayed correctly on date pages ex. /events/listings/2012/01/28

    Some background information.

    *  Upgrading to the latest release of EE is not an option so we must fix this in the current version.

    *  “Allow members to set their own localization preferences?” is set to “no”

    *  “Server Time Zone” is set to “(UTC -6:00) Central Standard Time”

    *  “Server Offset (in minutes)” is set to “0”

    *  “Default Time Formatting” is set to “United States”

    *  “Daylight Saving Time” is set to “Yes”

    *  Php info shows “Default timezone” is “America/Chicago”

    We have an entry published with the date of “2012-01-28 02:42 AM”

    The entry displays on /events/listings/2012/01/27 but not on /events/listings/2012/01/28

    Digging through build_sql_query in mod.channel.php the $stime and $etime are correct until they are adjusted for $this->EE->localize->set_localized_offset() 

    It seems as though something is off and entries are either being localized when they shouldn’t be or are being adjusted incorrectly.

    Please let me know if there is any additional information you need.

    Thanks!
    -Shawn

  • #2 / Oct 27, 2011 11:39pm

    fostermade

    97 posts

    I’ve compared 2.1.3 to 2.3.1 and I see that

    $stime = $this->EE->localize->set_gmt(mktime(0, 0, 0, $month, $sday, $year));
    $etime = $this->EE->localize->set_gmt(mktime(23, 59, 59, $month, $eday, $year));

    has been changed to

    $stime = gmmktime(0, 0, 0, $month, $sday, $year);
    $etime = gmmktime(23, 59, 59, $month, $eday, $year);

    Making this change on 2.1.3 seems to fix the issue (very limited testing). 

    Can someone verify that this is the correct fix to apply for 2.1.3?

    Thanks!
    -Shawn

  • #3 / Oct 28, 2011 12:32am

    John Henry Donovan

    12339 posts

    Shawn,

    Our recommendation here is to actual upgrade to EE2.3.1
    Would that be possible for you to do?

  • #4 / Oct 28, 2011 11:44am

    fostermade

    97 posts

    Hi John,

    In an ideal world, yes.  But…  The project is pretty large (800+ hours of EE dev to date) and as much as I would like to upgrade the budget is done and the post upgrade testing would consume too much time.

    I’ll drive home the point that an upgrade needs to happen as soon as it can be worked in.

    The change I posted above appears to fix the specific issue we are having with date urls.  Do you think it’s a reasonable temporary fix until I can a budget approved to move to a newer version of EE?

    Thanks!
    -Shawn

  • #5 / Oct 29, 2011 9:09am

    Mark Bowen

    12637 posts

    Hi Shawn,

    As long as you keep a good backup in case anything goes wrong then hopefully this will be okay for you.

    Obviously we can’t support changes to the core code like this so it would be up to you if you carry on in this way and we would definitely have to advise that you would be best to upgrade as soon as possible.

    That said if you’re okay with keeping that change then I’ll close this thread out and if you have any other issues with this or anything else related to this then please just go ahead and post another thread when and if needed.

    Thanks,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases