Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • TimMather 67 posts 78 karma points
    Feb 09, 2015 @ 15:43
    TimMather
    0

    getEvents not working for older start date

    When I try to getEvents with a historic start date (older than the current month) I get nothing returned.

    var startDate = new DateTime(inDate.Year, inDate.Month, 1).AddMonths(-6);
    var endDate = startDate.AddMonths(6);
    var monthEvents = Calendar.getEvents(startDate, endDate, "EventInfo", false);
    

    Any ideas?

  • Ole Martin Bakke 112 posts 624 karma points
    Feb 09, 2015 @ 20:38
    Ole Martin Bakke
    0

    I've tried this in my test enviroment, but I am not able to recreate you issue.

    @foreach (CalendarEvent ce in Calendar.getEvents(DateTime.Now.AddDays((DateTime.Now.Day * -1) +1).AddMonths(-6).Date, DateTime.Now.AddDays(1), "calendar", false)){
    
    }
    

    This returns events from 1st August 2014 and until today. This will only return published events.

    If you can take a screenshot of a couple of the events you would expect to get, that might help.

Please Sign in or register to post replies

Write your reply to:

Draft