Reactive Form with null date

3 posts, 1 answers
  1. Tim
    Tim avatar
    2 posts
    Member since:
    Sep 2015

    Posted 18 Mar 2019 Link to this post

    How can I use the Kendo-datepicker when I am using Reactive forms and the date field is nullable. So sometimes there is a date and sometimes there is not. I can't seem to make this work. An example of how to make this work would help.

    Currently, if the date is null or undefined, I get this HTML error:  "ERROR TypeError: Unable to get property 'toString' of undefined or null reference"

     

    Any advice would help.

    Thanks

     

  2. Answer
    Martin
    Admin
    Martin avatar
    152 posts

    Posted 20 Mar 2019 Link to this post

    Hi Tim,

    Thank you for the provided information.

    I tried to reproduce the reported undesired behavior of the DatePicker component using Reactive Forms, but there is no such error when the value is set to null. Check the following demo example demonstrating the functionality: 
    https://stackblitz.com/edit/angular-c1p95i?file=app/app.component.ts

    Let me know in case I am missing something.

    If further assistance is required for this case, could you provide some more detailed information about the use case scenario. Thank you in advance.

    Regards,
    Martin
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Tim
    Tim avatar
    2 posts
    Member since:
    Sep 2015

    Posted 25 Mar 2019 in reply to Martin Link to this post

    Martin, 

    Thanks for your response. Using your example I was able to make this work. 

    Tim

Back to Top