Timezones #43

Closed
linos wants to merge 4 commits from timezones into main
2 changed files with 24 additions and 2 deletions

View file

@ -276,6 +276,16 @@ abstract class Event extends Post {
return $template;
}
/** By default set the timezone of the WordPress site.
*
* This is likely to be overwritten by the actual transformer.
*
* @return string The timezone string of the site.
*/
public function get_timezone(): string {
return wp_timezone_string();
}
/**
* Generic function that converts an WP-Event object to an ActivityPub-Event object.
*

View file

@ -65,7 +65,7 @@ final class The_Events_Calendar extends Event {
$tags[] = $tag;
}
}
$tags[] = parent::get_tag();
$tags = array_merge( $tags, parent::get_tag() );
return $tags;
}
@ -94,7 +94,7 @@ final class The_Events_Calendar extends Event {
*
* @return string status of the event
*/
public function get_tribe_status() {
public function get_status() {
if ( 'canceled' === $this->tribe_event->event_status ) {
return 'CANCELLED';
}
@ -193,10 +193,22 @@ final class The_Events_Calendar extends Event {
}
$location->set_id( $venue->permalink );
$location->set_name( $venue->post_title );
$location->set_sensitive( null );
return $location;
}
/** By default set the timezone of the WordPress site.
*
* This is likely to be overwritten by the actual transformer.
*
* @return string The timezone string of the site.
*/
public function get_timezone(): string {
return $this->tribe_event->timezone;
}
/**
* Extend the default event transformers to_object function.
*