0

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 ?

7
  • clean soln and then try
    – Amit
    Commented Sep 22, 2014 at 7:50
  • 1
    Do you want the MM-dd-yyyy format or do you need a different one? You can always specify the target format in the datepicker call: $( ".selector" ).datepicker({ dateFormat: "dd-mm-yy" }); Remember that jQuery uses yy for the "full" 4 digit year format.
    – Andrei V
    Commented Sep 22, 2014 at 7:55
  • exactly what I want thank you for your answer!
    – intern
    Commented Sep 22, 2014 at 11:33
  • What does any of this have to do with the jquery-validate plugin? Please be more mindful when selecting your tags. Thanks.
    – Sparky
    Commented Sep 22, 2014 at 16:01
  • Sorry not to be as intelligent as you..
    – intern
    Commented Sep 23, 2014 at 6:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.