I have a problem with datepicker format, it sets the date to MM-dd-yyyy
. First, my model was set to following date format dd-MM-yyyy
, I've changed it to MM-dd-yyyy
in my model but nothing happen, the jqueryval script throw an error it wants the dd-MM-yyyy
format.
[DisplayFormat(DataFormatString = "{0:MM-dd-yyyy}", ApplyFormatInEditMode = true)]
public DateTime? dateOut_cash
{
get;
set;
}
So how can I set it to have everything working well ?
MM-dd-yyyy
format or do you need a different one? You can always specify the target format in thedatepicker
call:$( ".selector" ).datepicker({ dateFormat: "dd-mm-yy" });
Remember that jQuery usesyy
for the "full" 4 digit year format.