Possible duplicate of this question
But i tried that step (I received via POST) and didn't get success.
My globalization setting is <globalization uiCulture="en-in" culture="en-in"/>
and Template Code is
@model DateTime?
@Html.TextBox(
"",
Model.HasValue ? @ViewData.TemplateInfo.FormattedModelValue : "",
new { @class = "date" })
And meta data code
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}",
ApplyFormatInEditMode = true)]
[DisplayName("Employee Hire Date")]
public DateTime HireDate { get; set; }
and this is the js i am using
<script type="text/javascript">
$(function () {
$("input:text.date").datepicker({ dateFormat: "dd/mm/yy" });
});
</script>
It accepts the Date range as,
11/01/2015
7/05/2015
12/04/2015
But if i given this
30/04/2015
model validation fails.
Couldn't figure out the fix for this. I started learning MVC as a beginner. So please bear this question. Please help me.
UPDATE
If i change my js code like this $(function () { $("input:text.date").datepicker({ dateFormat: "dd/MM/yy" }); });
but the format changes to
'30/April/2015'
which i don't want.