From de59f01ff8a48d00ff0fed4b6e65cfe6cf74c5d1 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Apr 2017 16:30:48 +0530 Subject: [PATCH] [fix] Calendar colors - frappe/erpnext#8455 --- frappe/public/js/frappe/views/calendar/calendar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index f17e48b2e2..9006e112a7 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -225,15 +225,15 @@ frappe.views.Calendar = Class.extend({ let color; if(me.get_css_class) { color = me.color_map[me.get_css_class(d)]; + // if invalid, fallback to blue color + if(!Object.values(me.color_map).includes(color)) { + color = "blue"; + } } else { // color field can be set in {doctype}_calendar.js // see event_calendar.js color = d.color; } - // if invalid, fallback to blue color - if(!Object.values(me.color_map).includes(color)) { - color = "blue"; - } d.className = "fc-bg-" + color; return d; });