# Day view with event spanning multiple days

**URL:** <https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490>\
**Category:** Ignition\
**Created:** [June 9, 2017, 10:17pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490 "2017-06-09T22:17:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robot\_B9](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robot_b9/32/3599_2.png) [@Robot\_B9](https://forum.inductiveautomation.com/u/Robot_B9)\
**Post date:** [June 9, 2017, 10:17pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490/1 "2017-06-09T22:17:12Z")

</div>

I have a Calendar Month View component which I’m using to create events and from that calendar I can open a more detailed Day View.

If I have an event that spans multiple days the Month View shows the event on all the days it’s scheduled, however the Day View will only show the event on the day it starts. If I open the Day View on one of the subsequent days, I get nothing for that event.

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2017, 8:27pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490/2 "2017-06-10T20:27:24Z")

</div>

The components’ event properties have to be populated with a query that checks both start and end date of each row against the time span, not just the event start date. I strongly encourage the use of ‘half-open’ comparisons, where one expression uses greater-than-or-equal of the start point and the other uses a simple less-than of the end point. Something like:

```auto
SELECT "startDate", "endDate", "displayColor", "display"
FROM "eventTable"
WHERE "startDate"<'{Root Container.Day View.nextDate}' AND "endDate">='{Root Container.Day View.currentDate}'

```

Note that currentDate and nextDate are custom properties of the Day View Component that produce date strings that are compatible with your database. The following expressions generally work for almost any database:

```auto
dateFormat(getDate(
  toInt({Root Container.Day View.year}),
  toInt({Root Container.Day View.month}),
  toInt({Root Container.Day View.day})),
 'yyyy-MM-dd')

```

And:

```auto
dateFormat(getDate(
  toInt({Root Container.Day View.year}),
  toInt({Root Container.Day View.month}),
  toInt({Root Container.Day View.day}+1)),
 'yyyy-MM-dd')

```

{ The toInt() cast works around some data tyep bugs in various versions of Ignition, including v7.9.1 }

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2017, 8:34pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490/3 "2017-06-10T20:34:38Z")

</div>

Huh.  
Never mind. The Day View component itself is dropping the event. That’s a bug worthy of reporting.

---

<div class="post-metadata">

**Author:** ![Robot\_B9](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robot_b9/32/3599_2.png) [@Robot\_B9](https://forum.inductiveautomation.com/u/Robot_B9)\
**Post date:** [June 13, 2017, 4:20pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490/4 "2017-06-13T16:20:41Z")

</div>

Thanks,

I needed someone to verify what I was seeing.

---

<div class="post-metadata">

**Author:** ![Ryan\_Thompson](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@Ryan\_Thompson](https://forum.inductiveautomation.com/u/Ryan_Thompson)\
**Post date:** [December 27, 2022, 8:55pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490/5 "2022-12-27T20:55:15Z")

</div>

> [@pturmel](#):
>
> `"startDate"<'{Root Container.Day View.nextDate}' AND "endDate">='{Root Container.Day View.currentDate}'`

I was hoping someone has figured this out. I used your code and I return a query with everything that is shown on that day in the Month view, but it will not show it on the day view unless the event started that day. Any other ideas?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 27, 2022, 9:01pm UTC](https://forum.inductiveautomation.com/t/day-view-with-event-spanning-multiple-days/14490/6 "2022-12-27T21:01:33Z")

</div>

It was a bug. Don't know what happened to it, or what version might have the fix.
