jQuery datepicker entered invalid date is resolved to another date

jQuery datepicker entered invalid date is resolved to another date

I am using the jQuery datepicker. When I enter an invalid date like 1-1-0004, this date will be resolved to 1-1-1994. When I enter 1-1-2004, this date will be resolved to 1-1-1944. Why is this happen?


I can reproduce this on the jQuery datepicker demo page.


I would like to avoid this situation. It needs to be only possible to enter valid dates. And the date you enter needs to be same as in the datepicker. Not resolved to another date.



$("input.field.date").addClass("ui-datepicker").datepicker({
        dateFormat: 'dd-mm-yy',
        changeMonth: true,
        changeYear: true,
        showOn: 'both',
        buttonImageOnly: true,
        buttonImage: "/_layouts/15/Images/BrabantWater.Klantportaal.Branding/calendar.png",
        beforeShow: function () {
            setTimeout(function () {
                $(".ui-datepicker").css("z-index", 99999999);
            }, 10);
        },
  buttonText: ""

    }, $.datepicker.regional["nl"]);