Hi,

Today i updated my event module with latest version of 5.x-2.x-dev . The problem is for current month the number of days left for that event in "upcoming events" block is showing correct value but for next month onwards irrespective of what month or day the event is it is showing "34 days" for all events. I assume it is a bug.

--rafi

CommentFileSizeAuthor
#3 event.sql_.tgz758 bytestrungdong

Comments

trungdong’s picture

Just wonder if anyone has a chance to look at this. I trace the problem to an SQL query with TIMEDIFF(e.event_start, '%s') AS time_left in event_database.*.inc. However, nothing looks wrong to me.
It's getting more and more annoying when my site's users add more events long in the future and they're all displayed as 34 days away :(.

gerhard killesreiter’s picture

Status: Active » Postponed (maintainer needs more info)

Can any of you provide a dump of their event table?

trungdong’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new758 bytes

My event table dump is attached.
You might need to rename the file to .gz.

Steel Rat’s picture

Actually I've noticed that events in the current month are off by one day as well. Example, an event I set for August 18 (today is the 14th) shows 3 days as the remaining time, when it's in fact 4 days. Same for an event for the 30th, showed as 15 days even though it's 16.

I made a simple correction in event.module to increment the $days variable if it was greater than zero. But I don't know if the fix will break anything else. Here's what I did:

In function event_block_upcoming:

          // see if the remainder of hours on the event date is greater than the hours left in today, if so increase the days by one so that the days remaining mimics the date rather than how many 24 hour periods there are between now and then.
          if ($hours > $hours_left) {
            $days++;
          }
/******My Changes **********
          if ($days > 0){
            $days++;
          }
/******End of My Changes ******
          $timeleft = format_plural($days, '1 day', '@count days');
        }
      }
      else {
        $timeleft = t('Now');
      }
Steel Rat’s picture

I have one event for next month, and it's showing the correct number of days (24), though it showed 23 before my "fix". So it's a different problem. Sorry, I guess I should have posted as a new issue.

killes@www.drop.org’s picture

Status: Active » Fixed

This was fixed some time ago.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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