I'm trying to get the number of the current day in the week where Monday would be 0 or 1 and Sunday would be 6 ou 7 or something like that.
Arcade and Field Maps have isoweekday() but I can't seem to do it with survey123.
I realize I can get the first three letters of the day name (format-date(today(),'%a')), but it would really be easier with the day number.
Thanks!
Solved! Go to Solution.
Hello @mikaël,
You can use a JavaScript function to perform the calculation. The JavaScript Date object has a getDay method that returns the day of the week between 0 and 6. You can add 1 to the number returned to return 1-7. I've attached a sample survey that demonstrates the workflow.
Hello @mikaël,
You can use a JavaScript function to perform the calculation. The JavaScript Date object has a getDay method that returns the day of the week between 0 and 6. You can add 1 to the number returned to return 1-7. I've attached a sample survey that demonstrates the workflow.