Skip to content
Browse files

Merge pull request #98 from graphaelli/event-end_time-timestamp

allow end_time as seconds since the epoch
  • Loading branch information...
2 parents 4f07533 + 8bfe86f commit 2bd9e9d429b90a444cfd1b31d8599340f307d728 @jbuchbinder jbuchbinder committed
Showing with 9 additions and 2 deletions.
  1. +9 −2 api/events.php
View
11 api/events.php
@@ -66,8 +66,15 @@
"description" => $description
);
- if ( isset($_REQUEST['end_time']) )
- $event['end_time'] = $_REQUEST['end_time'] == "now" ? time() : strtotime($_REQUEST['end_time']);
+ if ( isset($_REQUEST['end_time']) ) {
+ if ( $_REQUEST['end_time'] == "now" )
+ $end_time = time();
+ else if ( is_numeric($_REQUEST['end_time']) )
+ $end_time = $_REQUEST['end_time'];
+ else
+ $end_time = strtotime($_REQUEST['end_time']);
+ $event['end_time'] = $end_time;
+ }
$message = ganglia_events_add( $event );
break;

0 comments on commit 2bd9e9d

Please sign in to comment.
Something went wrong with that request. Please try again.