getTime() working on desktop, but not mobile phones

26 views Asked by At

I have the following Javascript in a Qualtrics project that works perfectly on a computer, but not on a mobile device...

Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
    const currentDate = Qualtrics.SurveyEngine.getEmbeddedData("currentDate");
    const currentQuestionValue = this.getChoiceAnswerValue();

    const dateDifference2 = new Date(currentQuestionValue).getTime() - new Date(currentDate).getTime() ;
    Qualtrics.SurveyEngine.setEmbeddedData("dateDifference2", dateDifference2); 

    console.log("Current Date: " + currentDate)
    console.log("Current Question Value: " + currentQuestionValue)
    console.log("Date Difference2 : " + dateDifference2)
});

The "dateDifference2" field is blank when survey is completed on phone

0

There are 0 answers