WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: The Events Calendar] same day events getting moved to "past" events ? (15 posts)

  1. theblogdoctor
    Member
    Posted 4 years ago #

    Hi,

    I am noticing that events on the "day of" are getting moved from the "upcoming" to "past".

    Ex. Today is Feb 11. Time is 7:45 PM PST.
    I had an event with
    start datetime as Feb 11. Time is 5:45 PM PST
    and
    end datetime as Feb 11. Time is 8:45 PM PST

    somewhere in the morning itself, the event disappeared from "upcoming" and went into "past" !

    I need it to be visible in the "upcoming" until the time ends, i.e. until 8:45 PM for this example event.

    I checked the wordpress timezone settings and it is set to Los Angeles.
    I am going to check the PHP code now to see where this check for upcoming vs past is being done, meanwhile, if any of you know the solution to this issue, please let me know

    thanks
    -Shiva

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. theblogdoctor
    Member
    Posted 4 years ago #

    Ok, I think I have found the code, and possibly the source of this issue.

    The website's timezone inside wordpress is set to Los Angelese and is a US website, but the actual site is hosted on servers in Paris (France). Paris time is head of US by 9 hours, and it looks like the code is using the system (server time) ? Is that right ?

    /**
     * where filter for standard wordpress templates.  Inspects the event options and filters
     * event posts for upcoming or past event loops
     *
     * @param string where clause
     * @return string modified where clase
     */
      public function events_search_where( $where ) {
          if( !$this->in_event_category() ) {
            return $where;
          }
          $where .= ' AND ( eventStart.meta_key = "_EventStartDate" AND eventEnd.meta_key = "_EventEndDate" ) ';
          if( events_displaying_month( ) ) {
    
          }
          if( events_displaying_upcoming( ) ) {
            // Is the start date in the future?
            $where .= ' AND ( eventStart.meta_value > "'.$this->date.'" ';
            // Or is the start date in the past but the end date in the future? (meaning the event is currently ongoing)
            $where .= ' OR ( eventStart.meta_value < "'.$this->date.'" AND eventEnd.meta_value > "'.$this->date.'" ) ) ';
          }
          if( events_displaying_past( ) ) {
            // Is the start date in the past?
            $where .= ' AND  eventStart.meta_value < "'.$this->date.'" ';
          }
          return $where;
        }
  3. effendi13
    Member
    Posted 4 years ago #

    Hi theblogdoctor,

    That is correct. This is a known issue and I will add your comments to the bug report.

    R/S Aaron Rhodes

  4. theblogdoctor
    Member
    Posted 4 years ago #

    Thanks Aaron.

    Is there a workaround meanwhile ? I think I could change the plugin code, but the changes will be over-written next time you publish an upgrade, right ?

    Please advise.

    -Shiva
    @theblogdoctor

  5. theblogdoctor
    Member
    Posted 4 years ago #

    Hi,

    Never mind, I updated the event-calendar class in the plugin to return the local time....

    -Shiva

  6. fehnman
    Member
    Posted 4 years ago #

    @Shiva: Mind sharing the code?

  7. agilewebdev
    Member
    Posted 4 years ago #

    I'm having problems with this as well. Will it be fixed in the 1.5.5 release? If not is there a workaround in the meantime?

    Tammy

  8. Shane Pearlman
    Modern Tribe
    Posted 4 years ago #

    Yes the fix is in 1.5.5

  9. fehnman
    Member
    Posted 4 years ago #

    Hm. This has not been fixed for me. It works in the calendar/grid view, but today's events are still moved to "previous events" in the events list view.

    Any ideas?

  10. Shane Pearlman
    Modern Tribe
    Posted 4 years ago #

    Hey Fehnman,

    Can you give me as much details as possible. We have tested the patch successfully with other users.

  11. fehnman
    Member
    Posted 4 years ago #

    I'm running WordPress 2.9.2, with timezone set to "Berlin", and "week starts monday".

    When I click on the "Events List" button, I get a list of events, however, today's events don't show up. They do show up on the "previous entries", with the correct date of *today*. They also show up on the calendar/grid.

    Which part of the code makes use of my server's time anyway? Is it the i18n-part?

    Thanks

  12. Shane Pearlman
    Modern Tribe
    Posted 4 years ago #

    It should be using the timezone set in wordpress. What timezone have you set in your general settings?

  13. Paul
    Member
    Posted 4 years ago #

    I have the same problem with todays events only showing in the previous event list.

    Timezone is set to Oslo.
    I'm using version 1.5.6 with wordpress 2.9.2.
    Any feedback would be great.
    I can try to fix the code myselft if I'm pointed in the right direction, thanks in advance!

  14. picarillo
    Member
    Posted 4 years ago #

    I am also experiencing this issue.

    grid view is fine, Event list is not showing same day events nor is the sidebar widget.

    time zone is set to UTC time -4

    (UTC time is 1:56 am UTC -4 is 9:56 pm ) actual time is 10:06 pm

  15. picarillo
    Member
    Posted 4 years ago #

    it looks like it was corrected in 1.5.6

    my original install was 1.5.5

    I upgraded, but it did not work because when I did the original install
    I had to place the plugin in a directory called the-events-calendar2

    The upgrade created a new the-events-calendar directory with version 1.5.6

    so I manually replaced the-events-calendar.php version 1.5.5 found in the the-events-calendar2 directory with the-events-calendar.php 1.5.6 file found in the the-events-calendar dir

Topic Closed

This topic has been closed to new replies.

About this Topic