i have problem with validation this date format in kedno UI: dd.MM.yyyy
For my culture (CS-CZ) kendo use this pattern: d. M. yyyy
, but mostly used is format dd.MM.yyyy
.
I tried everythnik but no success yet :/
My model:
public DateTime? ExpirationDate { get; set; }
My kendo form:
<div class="form-group">
@Html.LabelFor(model => model.ExpirationDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
<div class="checkbox">
@(Html.Kendo().DatePickerFor(model => model.ExpirationDate)
.Name("ExpirationDate")
.Culture("cs-CZ")
.HtmlAttributes(new { style = "width:150px" })
)
@Html.ValidationMessageFor(model => model.ExpirationDate, "", new { @class = "text-danger" })
</div>
</div>
Thanks!
Use a Javascript function to validate:
In View use this
In web config, section system.web configure your culture
In layout you need to include kendo culture javascript file
and add javascript code
Kendo documentation
Or try to add custom rule for your date input:
try this: