IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 402 | 402 | */ |
| 403 | 403 | protected function trim_events( $response_body ) { |
| 404 | 404 | if ( isset( $response_body['events'] ) ) { |
| 405 | | $wordcamps = array(); |
| 406 | | $current_timestamp = current_time( 'timestamp' ); |
| | 405 | $wordcamps = array(); |
| | 406 | $today = current_time( 'Y-m-d' ); |
| 407 | 407 | |
| 408 | 408 | foreach ( $response_body['events'] as $key => $event ) { |
| 409 | 409 | /* |
| … |
… |
|
| 415 | 415 | continue; |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | | $event_timestamp = strtotime( $event['date'] ); |
| | 418 | // We don’t get accurate time with timezone from API, so we only take date part (Y-m-d). |
| | 419 | $event_date = substr( $event['date'], 0, 10 ); |
| 419 | 420 | |
| 420 | | if ( $current_timestamp > $event_timestamp && ( $current_timestamp - $event_timestamp ) > DAY_IN_SECONDS ) { |
| | 421 | if ( $today > $event_date ) { |
| 421 | 422 | unset( $response_body['events'][ $key ] ); |
| 422 | 423 | } |
| 423 | 424 | } |