Date parsing issue

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

    Posted 13 Mar 2018 Link to this post


    We have faced some interesting behavior - 


    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?


  2. Viktor Tachev
    Viktor Tachev avatar
    2470 posts

    Posted 15 Mar 2018 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.

    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