Add to Google Calendar

This topic contains 5 replies, has 2 voices, and was last updated by  Emer Harkin 7 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24882

    Hello,

    I am having difficulty with Google Calendar

    When I Clicked Add to Google Calendar the link opens Google Calendar but not with the current day, in Google Calendar show old date of event.

    The events have reoccurrence dates, for example a event start in Jul, 6 2015 10:00 AM but the event has reoccurrence and today in the website show November 1, 2016, when I Clicked Add to Google Calendar the link opens Google Calendar but show Jul, 6 2015 10:00 AM, I need in Google Calendar show the current day.

    We use the function Based on the documentation I did change the code per this URL.
    http://codex.wp-event-organiser.com/function-eo_get_add_to_google_link.html

    This is a event https://gradyhealth.org/events/car-seat-safety/

    The link is named: Add to Google Calendar.

    Also I need make it default to our timezone (Atlanta , United States) in Google Calendar, this is possible? How?

    Thanks.

    Emer Harkin
    #24901

    Hi Emer,

    How did you use the function, did you pass an occurrence ID?

    Regarding the timezone, the user can configure the timezone in which the event is viewed in Google calendar via Google calendar’s settings. The event is sent to Google in UTC format.

    Events in Event Organiser are defined in the timezone of the blog.

    Stephen Harris
    #24902

    I’ve just noticed the context of your ‘add to Google’ button is used – on the single event page.

    Please note that the ‘add to Google’ function is for individual dates. You can however, use the subscribe shortcode to add a link to subscribe to the event in Google (this adds a calendar in the user’s Google calendar account with the events).

    As far as I’m aware Google do not have an API to add a recurring event which isn’t actually ‘subscribing’.

    Stephen Harris
    #24907

    Hi,
    This shorcode http://docs.wp-event-organiser.com/shortcodes/subscribe-link/” did not work, show this message in Google Calendar: ‘This email address isn’t associated with an active Google Calendar account https://gradyhealth.org/feed/eo-events/. Please check the email address and try again’.
    I want that if the current date NOVEMBER 17, 2016 / 9:00 AM – 10:00 AM when I clicked in Add to Calendar show this dates, not past dates.
    This is possible?
    Thanks

    • This reply was modified 7 years, 5 months ago by  Emer Harkin.
    • This reply was modified 7 years, 5 months ago by  Emer Harkin.
    Emer Harkin
    #24913

    Does the link here work for you? There is no email address to be configured, so I can only assume you’re logged-in into a Google account which doesn’t have Google calendar enabled.

    In any case, if you want to use the add to Google link then you’ll need to supply an occurrence ID. You can get the ID of the event’s next occurrence as follows:

    $occurrence = eo_get_next_occurrence_of( get_the_ID() );
    if ( $occurrence ) {
        $occurrence_id= $occurrence['occurrence_id'];
        $url = eo_get_add_to_google_link( get_the_ID(), $occurrence_id );
        echo '<a href="'.esc_url($url).'"> Add to Google </a>'; 
    } else {
        //no more occurrences remaining
    }
    
    Stephen Harris
    #24914

    Hello,

    This function works well.

    Thanks.

    • This reply was modified 7 years, 5 months ago by  Emer Harkin.
    Emer Harkin
Viewing 6 posts - 1 through 6 (of 6 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.