Hi there,
I need to update the default calendar field to start displaying years from 2023 onwards, instead of showing earlier years.
JavaScript is beyond my capabilities - could someone please assist me with this?
Many thanks in advance!
Hi there,
I need to update the default calendar field to start displaying years from 2023 onwards, instead of showing earlier years.
JavaScript is beyond my capabilities - could someone please assist me with this?
Many thanks in advance!
If you click on the "</>" icon in the top right of the question, you'll see the question's JavaScript which starts with:
//Set years you would like to have available
var yearFirst = 1900; //Min 1900
var yearLast = 2049; //Max 2049
Update yearFirst to be 2023 and click Save. If you need to go beyond the default yearLast of 2049, the answer options of the Year column in the side by side question will need to be updated and the JavaScript adjusted slightly.
Thank you, Tom. I already tried it, and it worked. However, I’m now facing another issue.
In the Data & Analysis tab, the date appears in three separate fields (Month, Day, and Year). I created a new field from Field Editor to concatenate these, but when displaying the values, the year shows as a serial number (e.g., 2024 appears as 125).
I suspect this is due to the updated JavaScript code. I consulted ChatGPT for assistance, but after about 20 prompts and tests, it either displays no year or shows the serial number.
Do you have any ideas on how this can be resolved?
Thanks,
Violeta
You have two choices:
You could recode the years of interest (2024 from 125 to 2024, 2025 from 126 to 2025, etc.)
OR
Add embedded data field ‘year’ to your survey flow and add this to the bottom on the addOnLoad function (after mo.onchange):
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
Qualtrics.SurveyEngine.setEmbeddedData("year",yr.selectedOptionsO0].text);
});
Then use the embedded data field ${e://Field/year} in your Feedback Collection Date concatenation.
Hi Tom,
Thank you for your advice! I’d prefer to proceed with recoding, as I already have an embedded field for the year that categorizes the record date into fiscal quarters (our fiscal year doesn’t start in January). Below are the details.
Could you clarify where you suggest performing the recoding? I attempted to do this in the related dashboard’s Year field (which actually doesn’t make much sense), but everything seems fine there (see the second screenshot).
Best,
Violeta
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.