1

I have a form that accepts employee's date of birth and I have used jquery datepicker ui for that. I want the date picker to use the 'dd-mm-yyyy' format. any help would be greatly appreciated - thanks

<div class="editor-field">
            @Html.EditorFor(model=>model.DOB)
        </div>

<script type="text/javascript">
    $(document).ready(function () {
        $('#DOB').datepicker();
     });
</script>
0

1 Answer 1

3

you can specify the dateformat as below

$('#DOB').datepicker({ dateFormat: 'dd-mm-yyyy' })
Sign up to request clarification or add additional context in comments.

3 Comments

thanks. I tried datepicker({dateFormat:'dd-mm-yy'}) and it worked..
Welcome :-) Kindly accept the answer and request you to google before asking questions.
Agreed with @Santosh. Not only would Google have quickly turned up an answer, but there's at least three related SO questions just in the sidebar that would have given you answer. Please also pay attention to existing questions when creating a new one. SO shows you dupes automatically as you're typing your title.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.