Copied to clipboard

Flag this post as spam?

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


  • Bjorn Simpson 9 posts 49 karma points
    Sep 04, 2014 @ 00:40
    Bjorn Simpson
    0

    Bug? getEvents error when querying on a specific day, when the event spans several days

    I'm having an issue with getEvents, when I try to find a non-recurring event that spans several days. The issue occurs when I getEvents for a specific day within my event's timespan. I would expect it to return the event but it does not. To reproduce the issue:

    1. Create a new non-recurring event called Event1, with a start date of Sept 1 at 8 am and and end date of Sept 5 at 6 pm.

    2. Call getEvents for a single day within that timespan, such as Sept 2 at 8 am through Sept 2 at 6 pm.

    Expected results: Event1 is returned, since it takes place during the range of my query.

    Actual results: Event1 is not returned. Event1 is only returned if the start date in my query equals or preceeds the event's start date. It doesn't seem to matter if my query's end date comes before or after the event's end date.

    Thanks again for your work on this project!

  • Ole Martin Bakke 112 posts 624 karma points
    Sep 04, 2014 @ 13:05
    Ole Martin Bakke
    0

    Try the newest release. That will hopefully give you the result you want.

  • Bjorn Simpson 9 posts 49 karma points
    Sep 05, 2014 @ 18:53
    Bjorn Simpson
    0
    Thanks again for the very quick turnaround! Again I am very grateful.
    However I'm still seeing an issue with this new version.
    I have a non-recurring event named Event1, start date of Sept 1 2014 at 6am, end date of Sept 5 at 6pm.
    I have two getEvents queries. The first does a getEvents for all events between DateTime.MinValue and DateTime.MaxValue, e.g.:
    @foreach (KS.Umbraco7.Calendar.Core.CalendarEvent ce in KS.Umbraco7.Calendar.Core.Calendar.getEvents(DateTime.MinValue, DateTime.MaxValue, "calendar", EventsNodeId))
    {
        <li>
            @ce.startDate - @ce.endDate : @ce.content.Name
        </li>
    }
    The second does the same except it queries for events between Sept 3 2014 at 6 am and Sept 3 2014 at 6pm.
    My assumptions may be incorrect about what to expect from these queries, but I'm expecting the output of the two to be the same, namely:
    9/1/2014 8:00:00 AM - 9/5/2014 6:00:00 PM : Event1
    In version 0.1.5, the output of the first query (DateTime.MinValue to DateTime.MaxValue) is
    9/1/2014 8:00:00 AM - 9/5/2014 6:00:00 PM : Event1 (seems correct)
    In version 0.1.5, there is no output for the second query (just Sept 3). (seems incorrect)
    In version 0.1.6, the output of the first query is
    9/1/2014 8:00:00 AM - 9/1/2014 11:59:59 PM : Event1
    9/2/2014 12:00:00 AM - 9/2/2014 11:59:59 PM : Event1
    9/3/2014 12:00:00 AM - 9/3/2014 11:59:59 PM : Event1
    9/4/2014 12:00:00 AM - 9/4/2014 11:59:59 PM : Event1
    9/5/2014 12:00:00 AM - 9/5/2014 6:00:00 PM : Event1
    In version 0.1.6, the output of the second query is still empty.
  • Ole Martin Bakke 112 posts 624 karma points
    Sep 05, 2014 @ 20:23
    Ole Martin Bakke
    0

    Just uploaded a new build of version 0.1.6 that takes care of the second issue.

    Regarding the event listing there are a couple of challenges.One of them is when you want to output the calendar day by day, then you propably what a spanning event to be listed each day. The other is when you want to list upcoming or ongoing events in a listview or something, then you probably just want to list this events once.

    Therefor, in the latest build I've added the optional boolean parameter splitNoneRecurring to all methods. This is true by default and is added as the last parameter.
    If you do not set this or set it to true none recurring events spanning several days will be split into one event for each day. If you set it to false you will get only one single event with the real start and enddate.

    Give it a try, and let me know if this helps you out.

  • Bjorn Simpson 9 posts 49 karma points
    Sep 06, 2014 @ 00:12
    Bjorn Simpson
    0

    My thanks again. The first issue is definitely fixed. However I'm seeing an issue with the splitNoneRecurring parameter. It doesn't seem to matter how it's set, the results are always the same, it uses the default value of true.

    I looked at the code and noticed that many of the calls from the various getEvents methods to getEventList do not actually include the new splitNoneRecurring parameter, so it never actually makes it to getEventList and defaults to true.

    I also noticed that the method "getEvents(DateTime startDate, DateTime endDate, string propertyType, int nodeId)" didn't get the new splitNoneRecurring parameter.

    Thanks!

  • Ole Martin Bakke 112 posts 624 karma points
    Sep 06, 2014 @ 09:54
    Ole Martin Bakke
    100

    Doh... That's not good... Sorry about that.
    I've just uploaded the latest build of version 0.1.6 where I have double checked that the new parameter is included in and used by every method.

  • Bjorn Simpson 9 posts 49 karma points
    Sep 07, 2014 @ 01:57
    Bjorn Simpson
    0

    Perfect, thanks so much!

  • Ole Martin Bakke 112 posts 624 karma points
    Sep 07, 2014 @ 16:47
    Ole Martin Bakke
    0

    If your issues are resolved, I would very much appreciate it if you would mark the topic as solved :)

  • Jeroen Ribbink 21 posts 50 karma points
    Oct 20, 2014 @ 16:39
    Jeroen Ribbink
    0

    i Still got this problem. I have an event which spans for several days. it started at 13th of october and it end at the 26th of october.

    the startdate is DateTime.Now and the enddate is DateTime.Now.AddMonths(1)

    I expected that the event will appear for the remaining days until the end date.

    hope you can try fixing this.

    I installed v 0.1.7.1, before I used 0.1.2.

    Kind regards,

    Jeroen

  • Ole Martin Bakke 112 posts 624 karma points
    Oct 21, 2014 @ 15:54
    Ole Martin Bakke
    0

    Hei, Jeroen.

    I just uploaded a new build that should fix this issue. (0.1.7.2)

  • Jeroen Ribbink 21 posts 50 karma points
    Oct 22, 2014 @ 14:29
    Jeroen Ribbink
    0

    Thanks Ole Martin,

    I'll check if the updat solved my problem.

    kinds regards,

    Jeroen

  • Jeroen Ribbink 21 posts 50 karma points
    Oct 22, 2014 @ 14:35
    Jeroen Ribbink
    0

    Hi Ole Martin,

    It did solve my problem. It now works fine.

    thanks a lot.

Please Sign in or register to post replies

Write your reply to:

Draft