Could you help to fix this script?
I need to calculate the number of days between showDate and current date. if the number of days is greater than 56 then screenOut is true else false.
Currently this is not working and populating false in all tests whether is > or <.
Qualtrics.SurveyEngine.addOnload(function() {
/* Place your JavaScript here to run when the page loads */
var showDate = "${e://Field/TagShowDate}"; // Replace with the actual embedded data
var currentDate = new Date();
var showDateObj = new Date(showDate);
var daysDifference = Math.floor((currentDate - showDateObj) / (1000 * 60 * 60 * 24));
if (daysDifference > 56) {
Qualtrics.SurveyEngine.setEmbeddedData("screenOut", "true");
} else {
Qualtrics.SurveyEngine.setEmbeddedData("screenOut", "false");
}
});









