Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI DatePicker Warning on date format yyyy-MM-dd

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.

like image 472
MJDS Assessoria Avatar asked Jul 06 '15 18:07

MJDS Assessoria


People also ask

How to set kendo DatePicker format?

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.

How do I set the value of a kendo DatePicker?

click(function () { $("#StartDate"). data("kendoDatePicker"). value(new Date()); }); Above code don't give any error and don't set today date.

How do I show datetime in kendo grid?

{ field: "RequestedDate", title: "Requested Date", width: "150px", type:"datetime", template: "#= kendo. toString(kendo. parseDate(RequestedDate, 'yyyy-MM-dd'), 'dd MMM yyyy hh:mm') #" }, Thanks.


1 Answers

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.

like image 100
Mistyukov Dima Avatar answered Oct 03 '22 18:10

Mistyukov Dima