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 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
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.
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.
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.
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!
Try the newest release. That will hopefully give you the result you want.
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.
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!
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.
Perfect, thanks so much!
If your issues are resolved, I would very much appreciate it if you would mark the topic as solved :)
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
Hei, Jeroen.
I just uploaded a new build that should fix this issue. (0.1.7.2)
Thanks Ole Martin,
I'll check if the updat solved my problem.
kinds regards,
Jeroen
Hi Ole Martin,
It did solve my problem. It now works fine.
thanks a lot.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.