Calendar cell background color/icon binding

I ment to make this post http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=8297 into a feature request but it was locked before I could do so.

i’M looking for a way of binding the cell background colors on the calendar control to the date represented by that cell. I imagine this might be useful for others using the calendar control i.e. downtime tracking, coloring by daily production values, historical alarm/event viewing.

Cheers

Alex

was able to get a version of this to work using the month view component

steps:

  1. set the month views Event display mode to ‘highlight’
  2. you will need to drive the events table with your own query, my working one is as follows

SELECT [date] as startDate, [date] as endDate, 'blue' as color, 1 as description FROM mytable WHERE [date]>'{Root Container.Month View.monthStartDate}' AND [date]<='{Root Container.Month View.monthEndDate}'
where monthStartDate and monthEndDate are dynamic (are we calling the custom now?) properties driven as follows
Month End

dateArithmetic(dateArithmetic(todate({Root Container.Month View.selectedDay}),-dateextract(todate({Root Container.Month View.selectedDay}),"day" )+1,"day"),1,"month")
Month Start

dateArithmetic(todate({Root Container.Month View.selectedDay}),-dateextract(todate({Root Container.Month View.selectedDay}),"day" )+1,"day")

I’ve attached an example picture of what this looks like.


hi AlexW,

Nice find. I tried this way but I can’t change the color ; tried to change it to red or even a wrong color with no effect. Have you a way to go ? can you upload your windows ?
With what version of Ignition did you tried it ? I’m using 7.5…

TIA

Sorry my query can be a bit misleading. The color in the query is really just a placeholder. I don’t know what the component actually requires in terms of fields but I figured I may as well provide a table with the same number of columns and column names as what it expects.

SELECT [date] as startDate, [date] as endDate, 'blue' as color, 1 as description FROM mytable WHERE [date]>'{Root Container.Month View.monthStartDate}' AND [date]<='{Root Container.Month View.monthEndDate}'

should really be

SELECT [date] as startDate, [date] as endDate, 'blah' as color, 'blah' as description FROM mytable WHERE [date]>'{Root Container.Month View.monthStartDate}' AND [date]<='{Root Container.Month View.monthEndDate}'

The cell color is set by choosing the color for the “event highlight background” property

remember to set the month views event display mode to highlight