title: jQuery.Deferred exception: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded
body: <p>I have a problem with a part of my script from the Easy!Appointments software.</p>
  
  <p>I get the following errors:</p>
  
  <p><strong>jQuery.Deferred exception: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded
      at Date.$P.toString [as _toString] (<a href="https://DOMAIN/panel//assets/ext/datejs/date.js:49:911" rel="nofollow">https://DOMAIN/panel//assets/ext/datejs/date.js:49:911</a>)</strong></p>
  
  <p><strong>Uncaught RangeError: Maximum call stack size exceeded</strong></p>
  
  <p>It seems <strong>Date.today()</strong> is not working (properly)..</p>
  
  <p>Part of the code:</p>
  
  <pre><code>    $('#select-date').datepicker({
          dateFormat: 'dd-mm-yy',
          firstDay: 1, // Monday
          minDate: 0,
          defaultDate: Date.today(),
  
          dayNames: [
                  EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
                  EALang['thursday'], EALang['friday'], EALang['saturday']],
          dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
                  EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
                  EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
                  EALang['saturday'].substr(0,3)],
          dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
                  EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
                  EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
                  EALang['saturday'].substr(0,2)],
          monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
                  EALang['may'], EALang['june'], EALang['july'], EALang['august'], EALang['september'],
                  EALang['october'], EALang['november'], EALang['december']],
          prevText: EALang['previous'],
          nextText: EALang['next'],
          currentText: EALang['now'],
          closeText: EALang['close'],
  
          onSelect: function(dateText, instance) {
              FrontendBookApi.getAvailableHours(dateText);
              FrontendBook.updateConfirmFrame();
          },
  
          onChangeMonthYear: function(year, month, instance) {
              var currentDate = new Date(year, month - 1, 1);
              FrontendBookApi.getUnavailableDates($('#select-provider').val(), $('#select-service').val(),
                      currentDate.toString('yyyy-MM-dd'));
          }
      });
  </code></pre>