This is my code to display a DateTime selector with the dropdown in HTML,
<input id="FromDate" name="FromDate" style="width:90%" type="datetime-local" >
I use the following JQuery code to set the date to the previous month,
var dt = new Date();
var Fromdatetime = dt.getFullYear() + "-" + ("0" + (dt.getMonth())).slice(-2) + "-" + ("0" + dt.getDate()).slice(-2) + "T" + ("0" + dt.getHours()).slice(-2) + ":" + ("0" + dt.getMinutes()).slice(-2) + ":" + ("0" + dt.getSeconds()).slice(-2) ;
$("#FromDate").val(Fromdatetime)
After I execute the script, DateTime is set up correctly to a value one month before. But after that, I'm unable to modify the date-time using the HTML element as like before.
Can anyone suggest a solution for this?
Thanks in advance