I have a Datepicker that has this format set, and is associated with a textbox on my page (ASP MVC View):
$(function () {
$("#MyDateTextbox").datepicker({
dateFormat: "dd-M-yy",
showOn: "button",
buttonImage: "@Model.BaseURLOfSite" + "/Images/calendar.gif",
buttonText: "Calendar"
});
});
If the text field is originally empty, and I select a date from the control, and the date is saved in the dateFormat noted, when I click on my textbox again, the calendar opens to the date that was saved. Ex) "31-DEC-2020"
However, if text field already has a date with a format like "04/13/2020", a value that was saved to the text field (and database) before the picker was added to the page, when I click on the datepicker icon associated with the textbox, either the page locks up, or else the datepicker opens with today's date highlighted.
New dates set and saved with the datepicker control: no issue. Existing dates (in different format), and accessed by the datapicker control: there is the above problem.