Agenda does not work as expected
See original GitHub issueDo you want to request a feature or report a bug?
I think it is a bug.
What’s the current behavior?
The current behavior is that a event for today won’t be showed in the agenda. I checked the code of the Agenda component (Agenda.js) and I saw, that the library removes events which should not be showed in the agenda view. Thats totally ok for now!
The code looks like this:
export function inRange(e, start, end, accessors) {
let eStart = dates.startOf(accessors.start(e), 'day')
let eEnd = accessors.end(e)
let startsBeforeEnd = dates.lte(eStart, end, 'day')
// when the event is zero duration we need to handle a bit differently
let endsAfterStart = !dates.eq(eStart, eEnd, 'minutes')
? dates.gt(eEnd, start, 'minutes')
: dates.gte(eEnd, start, 'minutes')
return startsBeforeEnd && endsAfterStart
}
Please take a look into the eEnd variable. Why is this different from the eStart variable?
I tought the code should look like this: dates.endOf(accessors.end(e), 'day')
?
As you can see in the following image, my event starts at 5:30am and ends 10am.
If I continue the debugger to the end, you can see that the endsAfterStart returns false. But thats not true! The event definitely ends after the start date.
The end and start property from the arguments always have to same value for the agenda view, because this value is the current time.
Hopefully anyone can help me out if I do something wrong :x
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7
Top GitHub Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I’m seeing a similar issue. I have an all-day event for today, and it doesn’t show on the Agenda view unless I hit the back button. The default Agenda view which includes today should show today’s all-day event.