[Ticket cloned from T12036: Theme colors - How To?]
I have a date in the form of:
JavaScriptvar date = new Date(model.PatientBirthDate);
var localDateString = date.toLocaleDateString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit' });
So I would get something like "mm/dd/yyyy".
I have a datepicker in the survey, who asks for this specific date format, to which I am assigning the date value like this:
JavaScriptpatientSurvey.getQuestionByName("birthDate").value = localDateString;
Where birthDate is the name of the question in the survey.
But the date won't get assigned to the datepicker.
Any tips would help.