I have an input field that is being set as a date picker. When I initialize the dateFormat option it stops constraining the input and I can enter all sorts of rubbish dates in the text box. Why does this happen? I’d like to have constrained input still work when setting a custom date format.
myTextInput.datepicker({ dateFormat: "dd-M-yy" });
If I don’t set the dateFormat option then the input is constrained as expected.
It doesn’t appear to be the custom date format itself that is breaking it. It appears that when your dateFormat includes a string representation that it isn’t restricting.
This seems to work correctly.
So basically the codes M, MM, D and DD break it.