diff --git a/includes/class-import-facebook-events-ical_parser.php b/includes/class-import-facebook-events-ical_parser.php index f5f5baa..594b229 100644 --- a/includes/class-import-facebook-events-ical_parser.php +++ b/includes/class-import-facebook-events-ical_parser.php @@ -436,11 +436,11 @@ public function get_location( $event, $event_venue ) { // Extracting geometry $latitude = $geometry->location->lat; $longitude = $geometry->location->lng; - $id = strtolower(str_replace(' ', '_', $location_name ) ); + $id = strtolower(str_replace(' ', '_', $location ) ); $event_location = array( 'ID' => $id, - 'name' => isset( $location_name ) ? stripslashes( $location_name ) : '', + 'name' => isset( $location ) ? stripslashes( $location ) : '', 'description' => '', 'address_1' => $street_number . ' ' . $route, 'address_2' => '', diff --git a/includes/class-import-facebook-events-ical_parser_aioec.php b/includes/class-import-facebook-events-ical_parser_aioec.php index e3dd246..de300d9 100644 --- a/includes/class-import-facebook-events-ical_parser_aioec.php +++ b/includes/class-import-facebook-events-ical_parser_aioec.php @@ -319,9 +319,13 @@ public function generate_centralize_event_array( $event, $event_data = array() ) // Only for facebook ical imports. $match = 'https://www.facebook.com/events/'; if ( strpos( $url, $match ) !== false ) { + + $startDateTime = new DateTime( $start ); + $endDateTime = new DateTime( $end ); + $timezone = $wordpress_timezone; - $cwt_start = $this->convert_fb_ical_timezone( $start->format('Y-m-d H:i:s') ); - $cwt_end = $this->convert_fb_ical_timezone( $end->format('Y-m-d H:i:s') ); + $cwt_start = $this->convert_fb_ical_timezone( $startDateTime->format('Y-m-d H:i:s') ); + $cwt_end = $this->convert_fb_ical_timezone( $endDateTime->format('Y-m-d H:i:s') ); $timezone_name = $cwt_start['timezone_name']; $start_time = strtotime( $cwt_start['date_format'] ); $timezone_name = $cwt_end['timezone_name']; @@ -460,11 +464,11 @@ public function get_location( $event, $event_venue ) { // Extracting geometry $latitude = $geometry->location->lat; $longitude = $geometry->location->lng; - $id = strtolower(str_replace(' ', '_', $location_name ) ); + $id = strtolower(str_replace(' ', '_', $location ) ); $event_location = array( 'ID' => $id, - 'name' => isset( $location_name ) ? stripslashes( $location_name ) : '', + 'name' => isset( $location ) ? stripslashes( $location ) : '', 'description' => '', 'address_1' => $street_number . ' ' . $route, 'address_2' => '', diff --git a/languages/import-facebook-events.pot b/languages/import-facebook-events.pot index 0408ccb..3f0488c 100644 --- a/languages/import-facebook-events.pot +++ b/languages/import-facebook-events.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-04-20T09:59:01+00:00\n" +"POT-Creation-Date: 2024-04-20T10:29:15+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.10.0\n" "X-Domain: import-facebook-events\n"