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>
Ren
  • 1,493
  • 6
  • 31
  • 56

1 Answers1

3

you can specify the dateformat as below

$('#DOB').datepicker({ dateFormat: 'dd-mm-yyyy' })
Santosh
  • 12,175
  • 4
  • 41
  • 72
  • thanks. I tried datepicker({dateFormat:'dd-mm-yy'}) and it worked.. – Ren Apr 01 '13 at 17:09
  • 1
    Welcome :-) Kindly accept the answer and request you to google before asking questions. – Santosh Apr 01 '13 at 17:11
  • 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. – Chris Pratt Apr 01 '13 at 17:13