Automatically update the non working plan when changed in backend calendar.

This commit is contained in:
Alex Tselegidis 2020-12-12 14:54:41 +02:00
parent 194bb33821
commit ce40aa342b
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ window.BackendCalendar = window.BackendCalendar || {};
var successCallback = function () { var successCallback = function () {
Backend.displayNotification(EALang.working_plan_exception_saved); Backend.displayNotification(EALang.working_plan_exception_saved);
var workingPlanExceptions = jQuery.parseJSON(provider.settings.working_plan_exceptions) || {}; var workingPlanExceptions = JSON.parse(provider.settings.working_plan_exceptions) || {};
workingPlanExceptions[date] = workingPlanException; workingPlanExceptions[date] = workingPlanException;
@ -90,7 +90,7 @@ window.BackendCalendar = window.BackendCalendar || {};
var availableProvider = GlobalVariables.availableProviders[index]; var availableProvider = GlobalVariables.availableProviders[index];
if (Number(availableProvider.id) === Number(providerId)) { if (Number(availableProvider.id) === Number(providerId)) {
availableProvider.settings.working_plan_exceptions = JSON.stringify(workingPlanExceptions); GlobalVariables.availableProviders[index].settings.working_plan_exceptions = JSON.stringify(workingPlanExceptions);
break; break;
} }
} }