Getting InputDate value as string

Posted by: germiep.fernandez on 23 February 2022, 4:23 am EST

  • Posted 23 February 2022, 4:23 am EST

    Hi,

    I am trying the two-way binding to the input-date component. Is it possible to get the value of the input-date as a string formatted as ‘2021-01-09T00:00:00z’?

    <wj-input-date format="yyyy/MM/dd" [value]="null" [(ngModel)]="date"></wj-input-date>
    
  • Posted 24 February 2022, 1:31 pm EST

    Hi,

    We are sorry, we can’t get the direct ISO format string. But we may format the fetched date in the ISO format by calling the toISOString() method.

    Please refer to the following code snippet for reference:

    date.toISOString()

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels