From c8bf9d0d7ba311e0cd0c6bdfedddb42ac75afcdd Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 30 Apr 2019 11:43:26 +0200 Subject: [PATCH] fixed worker calendar error for local holidays --- modules/worker/front/calendar/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index dafa1d24d..bfb313630 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -40,10 +40,14 @@ class Controller { const holidays = data.holidays; const events = []; holidays.forEach(holiday => { + const holidayDetail = holiday.detail && holiday.detail.description; + const holidayType = holiday.type && holiday.type.name; + const holidayName = holidayDetail || holidayType; + events.push({ dated: holiday.dated, className: 'red', - title: holiday.detail.description || holiday.type.name, + title: holidayName, isRemovable: false }); });