views:

342

answers:

1

Is there somewhere somebody who did a mapping of the c# dateFormat to the datePicker dateFormat, since I already know the C# dateFormat, I don't want to have to check the datepicker documentation everytime I have to build a custom date Format.

for exmple, i want to be able to specify in my helper dateFormat of 'dd/MM/yy'(c#) and it would convert it to 'dd/mm/yy' DatePicker

A: 

Maybe you can use something like this:

<%= Html.TextBoxFor(x => x.SomeDate, new { @class = "datebox", dateformat = "dd/mm/yy" })%>

and this:

$(function() {
    $("input.datebox").each(function() {
        $(this).datepicker({ dateFormat: $(this).attr("dateFormat") });
    });
});
Сергій
That's not what i want, what i want, is to specify the same format in c# than in the datepicker, using a custom helper, so the conversion can be daone in c#, for example, 'dd/mm/yy' in the datePicker is 'dd/MM/yy' in c#.
moi_meme