How to change the color of the day flag in month view


#1

Hi

Does anyone know how to change the color of the day flag

.dhx_cal_day_num.dhx_cal_selected_day .day_with_events

based on a value of a custom field, in my case, category. The code I used on the desktop version of the site is…

Styling

		/*ANYTIME*/
		.dhx_cal_event.event_anytime div, .dhx_cal_event_line.event_anytime {
			background-color: darkblue !important;
			border-color: #839595 !important;
			color: white;
		}

		.dhx_cal_event_clear.event_anytime {
			color: darkblue !important;
		}

		/*METRIC*/
		.dhx_cal_event.event_metric div, .dhx_cal_event_line.event_metric {
			background-color: cyan !important;
			border-color: #839595 !important;
			color: black;
		}

and used this function to check the field…

			scheduler.templates.event_class = function (start, end, event, category) {
				var css = "";

				if (event.category) // if event has category property then special class should be assigned
					css += "event_" + event.category;

				if (event.id == scheduler.getState().select_id) {
					css += " selected";
				}
				return css; // default return

Any help would be appreciated.
Thanks for looking.


#2

Hi,

scheduler.templates.event_class is applied only for event items (lists in List, Day and Month views). Calendar in month views does not display specific events, it only marks days that contain at least one event.

Please read the following topic. Hope it will help to customize “calendar_event” template:

viewtopic.php?f=24&t=26861&p=85281