This is a migrated thread and some comments may be shown as answers.

valueChange() return null

4 Answers 285 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 17 Dec 2020, 01:30 AM

Hi,

When user enter only mm/dd, i need to show invalid date format error message. To do this i am trying to get the entered date value using valueChange() method. But valueChange() method only return date value if user enter mm/dd/yyyy like [12/12/2020]. When user enter partial value like [12/12/yyyy], it return null value. How can i get the partial date value?

Thanks

 

 

4 Answers, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 18 Dec 2020, 12:31 PM

Hi Saravanan,

In general the (valueChange) event of the DatePicker component returns either a valid JavaScript Date or null whenever the Date is changed. A JavaScript Date can either be valid or invalid. That is why, the (valueChange) cannot return a partial date as there isn't such partial date instance provided by the JavaScript Date.

Regards,
Svetlin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Saravanan
Top achievements
Rank 1
answered on 18 Dec 2020, 12:42 PM

Thank you Svetlin for your response.

So there is no way to get partial date from kendo date picker component? 

Thanks

Saravanan

0
Ivan
Telerik team
answered on 22 Dec 2020, 09:47 AM

Hello Saravan,

Yes correct, dateinput may validate partial date , but it is not possible to get this partial date at users disposal in the code.

 

Regards,
Ivan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Saravanan
Top achievements
Rank 1
answered on 23 Dec 2020, 01:23 AM
Thank you Ivan for your response.
Tags
DatePicker
Asked by
Saravanan
Top achievements
Rank 1
Answers by
Svet
Telerik team
Saravanan
Top achievements
Rank 1
Ivan
Telerik team
Share this question
or