Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
33
rated 0 times [  38] [ 5]  / answers: 1 / hits: 9472  / 10 Years ago, fri, march 21, 2014, 12:00:00

I'm at my wits end trying to force this jQuery datepicker control to understand specific date formats. What the hell is going on here?



View



@Html.TextBoxFor(model => model.StartDate, {0:dd/MM/yyyy}, new { @class = datefield })


Javascript



$(function () {
$(.datefield).datepicker({
dateFormat: 'dd/MM/yyyy',
showOn: button
});
});


On page load



On



datepicker clicked, so far so good



datepicker



date selected... what?



date


More From » jquery

 Answers
0

According to the documentation:




  • dd - day of month (two digit)

  • MM - month name long

  • yy - year (four digit)



So dd/MM/yyyy should produce that result. (The day, the long month name, and the 4-digit year twice.) To match your initially loaded format, you'd want this:



dd/mm/yy

[#46654] Thursday, March 20, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
myakylas

Total Points: 66
Total Questions: 85
Total Answers: 95

Location: Guadeloupe
Member since Sat, Aug 22, 2020
4 Years ago
myakylas questions
Thu, Apr 28, 22, 00:00, 2 Years ago
Thu, Apr 8, 21, 00:00, 3 Years ago
Sat, Sep 19, 20, 00:00, 4 Years ago
;