I have a warning on my page about of an invalid date format as you can see below. The warning is generated by Kendo UI DatePicker component. I can't find a solutions on the web, my app is localized pt-BR. How to solve this problem.
<p>@(Html.Kendo().DatePicker().Name("periodoDocumento").Value(DateTime.Now))</p>
Error in Google Chrome:
The specified value '06/07/2015' does not conform to the required format, 'yyyy-MM-dd'.
I must use day-month-year format for my client needs.
format String (default: "M/d/yyyy h:mm tt") Specifies the format, which is used to format the value of the DateTimePicker displayed in the input. The format also will be used to parse the input. For more information on date and time formats please refer to Date Formatting.
click(function () { $("#StartDate"). data("kendoDatePicker"). value(new Date()); }); Above code don't give any error and don't set today date.
{ field: "RequestedDate", title: "Requested Date", width: "150px", type:"datetime", template: "#= kendo. toString(kendo. parseDate(RequestedDate, 'yyyy-MM-dd'), 'dd MMM yyyy hh:mm') #" }, Thanks.
I found solution:
@(Html.Kendo().DatePicker().Name("periodoDocumento").Value(DateTime.Now).HtmlAttributes(new { @type = "" }))
So jquery will stop parsing this field as date with default format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With