Hi
In alert it is showing 16-10-22 but it is giving message Invalid Date
Thanks
Hi
In alert it is showing 16-10-22 but it is giving message Invalid Date
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Oct 15, 2022, 8:35 PM
16-10-22 is an invalid date format from JS perspective. Such format will always give you invalid date format.
You need to parse it in yyyy-mm-dd format first before passing it to new Date() method.
Vishal JoshiPosted Oct 14, 2022, 12:58 PM
Hello
You need to convert to datetime before pass to new Date() please check below code