I have implemented this solution to my school project
However I get this error from the console whenever I attempt to change the value of the initial date field
The specified value "2/21/2023" does not conform to the required format, "yyyy-MM-dd".
What could be wrong in the solution as it works in the example given
I tried change the
dueDateInput.value = dueDate.toLocaleDateString('en-CA');
into
dueDateInput.value = dueDate.toISOString();
and also
dueDateInput.value = dueDate.toLocaleDateString('bo-CN');
but to no avail
Since the browser says that this is the codeline that gives the error, how can I convert the dueDate to YYYY-MM-DD so that I can assign it as the value to the other date field