Bug in limit plugin when used with cookie plugin

There is an error in limit plugin when used with cookie plugin:

I set a limit to 3 months in the past - then the earliest date a user can visit is 30 july 2013. This value will also be saved by cookie plugin.

Next day the same user visit this page again. Now the earliest allowed date is 31 July 2013. However the cookie plugin saved 30 July and this date is beyond the allowed timeframe.

In this case no calendar will be displayed, refresh will not help. Only erasing all cookies will help. However no user know that. We already lost a few paying customers just because of this bug.

Please fix this and update the NuGet package ASAP.

A quick workaround for this problem:

window.onerror = function (msg, url) {
try {
    if (url.indexOf('dhtmlxscheduler_limit.js') != -1) {
        yourcookieplugin.eraseCookie('scheduler_here_settings', '/en/calendar');
        yourcookieplugin.eraseCookie('scheduler_here_settings', '/es/calendar');
        yourcookieplugin.eraseCookie('scheduler_here_settings', '/dk/calendar');
        //...and so on for every page
                
        if (confirm('An error occured. Reload page?')) {
            location.reload();
        }
    }
}
catch (err) { }
};

Put this at the top of page

Please try to use the updated js file instead of the original one.
dhtmlxscheduler_limit.zip (7.8 KB)