Date parsing issue

2 posts, 0 answers
  1. Elvis
    Elvis avatar
    17 posts
    Member since:
    Feb 2015

    Posted 13 Mar Link to this post

    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 13 2018 - current date). Is this expected behavior?

    Thanks.

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1907 posts

    Posted 15 Mar Link to this post

    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.
Back to Top