Previous month as well as 12 months ahead

Home Forums Calendar Products Events Calendar PRO Previous month as well as 12 months ahead

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1170365
    Bryan
    Participant

    We are using the following URL for our iCal feed : http://<domain>/calendar/?ical=1&year-feed=1

    It works in that we can always see a year into the future.

    The issue we have is that a meeting is removed from our calendar 10 minutes prior to the meeting start. A lot of my users have complained that meeting details (start time, room, location, agenda, etc) are suddenly gone right before the meeting.

    Is there a way to configure the feed so that it displays the past 30 days as well displays the next years worth of meetings? This would eliminate our issue.

    The iCal is setup as a subscribed calendar on an iOS device. There is no setting that allows me to keep the events on my calendar.

    Any help would be appreciated.

    Thanks,

    Bryan

    #1170540
    Cliff
    Member

    Hi Bryan.

    It sounds like you’re only asking about the iCal feed and not the RSS feed.

    If I’m understanding you correctly, you’re saying the iCal feed (that your users subscribe to) is working fine except that their calendars don’t update within the 10 minutes you change an event (e.g. at 11:50am, changing an event scheduled at noon).

    And you think this is because the iCal feed only includes future events and therefore you want to include past events to make sure their calendars update that event that starts at noon.

    Did I get all that correct?

    #1170555
    Bryan
    Participant

    Hi Cliff.

    Sorry about the RSS feed part – I was writing this while on a conference call. Never a good idea to multi-task.

    Your assessment of the issue is correct.

    The way it seems to work now, any past meeting is removed from my calendar. I’m fine with this; there’s no need to keep years worth of meetings. But the downfall to this is that right as the meeting is about to start, it’s removed from my iPhone calendar. I can only assume that my phone is doing a synch as I look at my calendar. I’ve looked for ways to tell it not to do this, but no luck. I was hoping the iCal feed could give a list of meetings that happened in the past (maybe last 30 days….even last 7 days would be fine) plus the events in the future. That way the event isn’t removed right as it starts.

    Thanks,

    Bryan

    #1170560
    Bryan
    Participant

    BTW – if you want to re-title this ticket/topic/post, please do so. That way others can find it should they encounter this same issue. I tried, but I didn’t see where to make the change.

    #1170677
    Cliff
    Member

    Thanks for confirming. I did remove “RSS Feed” from this thread’s title.

    Could you please provide the code snippet / plugin code you’re using to generate the year feed?

    #1170968
    Bryan
    Participant

    Ah…..I’m starting to see the light. I made some assumptions that the ical link was hardcoded, not generated by a custom function. You know what they say about assumptions….

    Here’s what I currently have:

    add_action( ‘pre_get_posts’, ‘tribe_custom_month_time_range_ics_export’ );

    function tribe_custom_month_time_range_ics_export( WP_Query $query ) {
    if ( ! isset( $_GET[‘ical’] ) || ! isset( $_GET[‘year-feed’] ) ) {
    return;
    }

    $query->set( ‘eventDisplay’ , ‘custom’ );
    $query->set( ‘start_date’ , ‘now’ );
    $query->set( ‘end_date’ , ‘+ 365 days’ );
    $query->set( ‘posts_per_page’, -1 );
    }

    For giggles, I changed the start_date parm to ‘- 30 days’ and this appears to have solved my issue.

    Thank you for pointing me in the right direction.

    -Bryan

    #1171272
    Cliff
    Member

    Awesome job! Thanks for sharing your code to clarify your answer and help others who may find this in the future.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Previous month as well as 12 months ahead’ is closed to new replies.