Changeset 7069 for sites/trunk/wp15.wordpress.net/public_html/content/plugins/wp15-meetup-events/wp15-meetup-events.php
- Timestamp:
- 04/09/2018 09:28:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wp15.wordpress.net/public_html/content/plugins/wp15-meetup-events/wp15-meetup-events.php
r7052 r7069 110 110 $event['longitude'] = ! empty( $event['venue']['lon'] ) ? $event['venue']['lon'] : $event['group']['group_lon']; 111 111 $event['group'] = $event['group']['name']; 112 $event['description'] = isset( $event['description'] ) ? $event['description']: '';112 $event['description'] = isset( $event['description'] ) ? trim( $event['description'] ) : ''; 113 113 $event['time'] = $event['time'] / 1000; // Convert to seconds. 114 114 $event['location'] = trim( implode( ' ', $location ) ); … … 306 306 */ 307 307 function get_local_formatted_date( $utc_timestamp, $timezone ) { 308 // translators: Do not include `T`, `P`, or `O`, because that will show the site's timezone/difference, not the event's. The event dates will already be converted to their local timezone. 308 309 $date_format = _x( 'F jS, Y g:ia', 'WP15 event date format', 'wp15' ); 309 310 … … 312 313 $utc_datetime->setTimezone( new DateTimeZone( $timezone ) ); 313 314 314 $local_timestamp = strtotime( $utc_datetime->format( $date_format ) ); 315 // Convert to a timestamp in the local timezone, in order to pass through `date_i18n()` for month name translation. 316 $local_timestamp = strtotime( $utc_datetime->format( 'Y-m-d H:i' ) ); 315 317 $formatted_date = date_i18n( $date_format, $local_timestamp ); 316 318 } catch ( Exception $exception ) {
Note: See TracChangeset
for help on using the changeset viewer.