In our survey, we want to show a previously collected date (preloaded) and show it in the label. We were also to do it but the date shows as 2020-08-26 (yyyy-mm-dd) format which is not very convenient to the interviewers. Is there any way to format it in 26 Aug 2020 (dd MMM yyyy) format?
In your example, ToString(“dd MMM yyy”) should work.
W.r.t to the preloading, not sure about the best approach:
Maybe create a hidden Date Question (prel_date) and then create an additional string variable with expression:
prel_date.ToString(“dd MMM yyy”)
I tried this. But it doesn’t compile.
dob_old is a hidden pre-loaded question.
dob_label is a variable with the expression
dob_old.ToString("dd MMM yyyy"). I get the following error:
Check your variable Type. It’s a boolean on the pic?
Changed it to string. Same error.
Ahh. I think you need to take the value of dob_old:
dob_old.Value.ToString(“dd MMM yyy”)
dob_old.Value.Date.ToString(“dd MMM yyy”)
Worked like a charm! Thank you.