function event_is_later in Event 5.2
Compares two dates in format YYYY-MM-DD HH:mm:ss or as a date array
Parameters
$date_a first date:
$date_b second date:
$type either "string" or "array":
Return value
TRUE if $date_a >= $date_b FALSE else
7 calls to event_is_later()
- event_calendar_data in ./
event.module - Returns an array of nodes that occur on a given date. Handles content type and taxonomy filters.
- event_calendar_list in ./
event.module - Creates a themed list of events.
- event_calendar_month in ./
event.module - Displays a monthly event calendar.
- event_calendar_table in ./
event.module - Creates a themed table of events.
- event_form_validate in ./
event.module
File
- ./
event.module, line 2647
Code
function event_is_later($date_a, $date_b, $type = 'array') {
if ($type == 'string') {
$date_a = event_explode_date($date_a);
$date_b = event_explode_date($date_b);
}
$date_a = mktime((int) $date_a['hour'], (int) $date_a['minute'], (int) $date_a['second'], (int) $date_a['month'], (int) $date_a['day'], (int) $date_a['year']);
$date_b = mktime((int) $date_b['hour'], (int) $date_b['minute'], (int) $date_b['second'], (int) $date_b['month'], (int) $date_b['day'], (int) $date_b['year']);
if ($date_a >= $date_b) {
return TRUE;
}
return FALSE;
}