I'm trying to use DateTimePicker in my application. I create Date.cshtml under the View/Shared/EditorTemplates folder and it consist something like this:
@model System.DateTime
@Html.TextBox("", Model.ToString("dd-MM-yyyy"),
new {@class = "tanggal", @maxlength = "10"})
then I create EditorHookup.js file under the script folder with the content like this:
$(document).ready(function () {
$('.tanggal').datepicker({
dateFormat: 'dd-MM-yyyy'
});
});
I expect to get the result to be like this: 01-01-2012 but the result is: 01-January-20122012
What should I do to fix that?