Making WordPress.org


Ignore:
Timestamp:
07/11/2019 01:39:47 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Make/Meetings: Show currently ongoing meetings (started no longer than an hour ago) on top of the list.

Props mikeschroder, SergeyBiryukov.
Fixes #4594.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-meeting-posttype/wporg-meeting-posttype.php

    r9037 r9038  
    8787                    $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) );
    8888                    $next  = $start;
    89                     $now   = new DateTime();
     89                    // minus 1 hour to account for currently ongoing meetings
     90                    $now   = new DateTime( '-1 hour' );
    9091
    9192                    if ( $next < $now ) {
     
    106107                    $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) );
    107108                    $next  = $start;
    108                     $now   = new DateTime();
     109                    // minus 1 hour to account for currently ongoing meetings
     110                    $now   = new DateTime( '-1 hour' );
    109111
    110112                    while ( $next < $now ) {
     
    122124                    $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) );
    123125                    $next  = $start;
    124                     $now   = new DateTime();
     126                    // minus 1 hour to account for currently ongoing meetings
     127                    $now   = new DateTime( '-1 hour' );
    125128
    126129                    $day_index = date( 'w', strtotime( sprintf( '%s %s GMT', $post->start_date, $post->time ) ) );
     
    148151                    $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) );
    149152                    $next  = $start;
    150                     $now   = new DateTime();
     153                    // minus 1 hour to account for currently ongoing meetings
     154                    $now   = new DateTime( '-1 hour' );
    151155
    152156                    while ( $next < $now ) {
Note: See TracChangeset for help on using the changeset viewer.