In my code I want to set the format of dates to d MM yy. I've tried the following but with no success:
$().ready(function () {
$.datepicker.setDefaults({ dateFormat: 'd MM yy' });
$("#Client_DateOfBirth").datepicker(
{
maxDate: "+0D",
dateFormat: 'd MM yy'
});
});
The date is set as follows:
<div class="registration-item">
<%: Html.LabelFor(model =>model.Client.DateOfBirth) %>
<%: Html.TextBoxFor(model => model.Client.DateOfBirth)%>
<%: Html.ValidationMessageFor(model =>model.Client.DateOfBirth) %>
</div>
The value is displayed as: 15-8-1988 0:00:00. I don't want this,I want 15 aug 1988.
When I pick a value from the datepicker,I get the right value. But when a value is already set,the format is not applied. How can I do this?