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

Date parsing issue

1 Answer 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Elvis
Top achievements
Rank 1
Elvis asked on 13 Mar 2018, 03:54 PM

Hello, 

We have faced some interesting behavior - 

kendo.parseDate("17:01")

returns "Tue Mar 13 2018 17:01:00 GMT+0200 (FLE Standard Time)"

Which means that this method much more data that we passing into (Tue Mar 2018 - current date). Is this expected behavior?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 15 Mar 2018, 11:14 AM
Hello Elvis,

The parseDate method will attempt to parse the provided string to a valid Date object. By default a Date will contain a date and also time, however, since the string that is passed as argument is only the time part the current date is used by default. 

If your application requires only the time value you can ignore the date part as described in the stackoverflow article below:


In case you have additional queries do not hesitate to contact us again.


Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Elvis
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or