I use a jquery datepicker in my ASP.NEt Application and I want if the User is from Spania or german I use a other dateformat.
Here is my jquery code:
$(function () {
$("#txtAbwesenheitBis").datepicker();
$("#format").change(function () {
$("#txtAbwesenheitBis").datepicker("option", "dateFormat", $(this).val());
});
});
How I can use a other dateformat? Or how I can use the german dateformat?
Here is a link where possible formatting options are shown. Just build required formatting string using description.
Upd:
To set a formatting string depending on lable value you may use something like this:
But note that if your lable has runat=”server”, its id on client side will not be the same as on server side, so you should use
$("#<%=lbllanguagelabel.ClientID %>").text()or, what is much simpler, define some unique class for it:and JS: