Skip to content

Commit

Permalink
Merge pull request #145 from xylusthemes/some_improvements
Browse files Browse the repository at this point in the history
some improvement
  • Loading branch information
Rajat1192 committed Apr 20, 2024
2 parents 95d7b34 + f220f57 commit f978d47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions includes/class-import-facebook-events-ical_parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '',
Expand Down
12 changes: 8 additions & 4 deletions includes/class-import-facebook-events-ical_parser_aioec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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' => '',
Expand Down
2 changes: 1 addition & 1 deletion languages/import-facebook-events.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f978d47

Please sign in to comment.