ExpressiveDate::lessThan PHP Method

lessThan() public method

Determine if date is less than another Expressive Date instance.
public lessThan ( ExpressiveDate $date ) : boolean
$date ExpressiveDate
return boolean
    public function lessThan(ExpressiveDate $date)
    {
        return $this < $date;
    }

Usage Example

function eme_db_update_recurrence($event, $recurrence)
{
    global $wpdb, $eme_timezone;
    $recurrence_table = $wpdb->prefix . RECURRENCE_TBNAME;
    $recurrence['modif_date'] = current_time('mysql', false);
    $recurrence['modif_date_gmt'] = current_time('mysql', true);
    // some sanity checks
    $eme_date_obj1 = new ExpressiveDate($recurrence['recurrence_start_date'], $eme_timezone);
    $eme_date_obj2 = new ExpressiveDate($recurrence['recurrence_end_date'], $eme_timezone);
    if ($eme_date_obj2->lessThan($eme_date_obj1)) {
        $recurrence['recurrence_end_date'] = $recurrence['recurrence_start_date'];
    }
    $where = array('recurrence_id' => $recurrence['recurrence_id']);
    $wpdb->show_errors(true);
    $wpdb->update($recurrence_table, $recurrence, $where);
    $wpdb->show_errors(false);
    $event['recurrence_id'] = $recurrence['recurrence_id'];
    eme_update_events_for_recurrence($event, $recurrence);
    if (has_action('eme_update_recurrence_action')) {
        do_action('eme_update_recurrence_action', $event, $recurrence);
    }
    return 1;
}
All Usage Examples Of ExpressiveDate::lessThan