Jump to content
  • 0

Change Color Of Field In Calendar



Hi there...


I have what is hopefully a simple question to resolve..


I am running a calendar data page which shows different codes for each date i.e for an individual client, they might shows as AV, NA, SH, PH, BC, BR or WE. 


Is it possible to put a code in the footer of the calendar results page so that each cell can be color coded differently for each of the above records e.g. AV = green, NA = red etc.


The alternative consideration would be for each value to be color coded rather than the entire cell i.e. the text would be different colors, not the cell.


The value field is [@field:RT_Diary_Availability]

The date field is â€‹â€‹[@field:RT_Diary_Diary_Date*] or â€‹[@field:RT_Diary_Diary_Date]


Many thanks...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello alanhoffman, 


You can paste following code into the Footer of the Calendar result page:

window.onload = function(){
var v_nodes = document.querySelectorAll('span[class*="cbResultSetData"]');
for(var v_i= 0 ; v_i < v_nodes .length; v_i++){
if(v_nodes.item(v_i).innerHTML.search('AV')!= -1){
v_nodes.item(v_i).style.color = '#00FFFF';
if(v_nodes.item(v_i).innerHTML.search('NA')!= -1){
v_nodes.item(v_i).parentNode.parentNode.parentNode.style.background = '#A00101';

Hope it helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...