Day of week as metadata

hello everybody....in the types of dates, as well as in the manual calendar, I cannot put the day of the week together with the date, example: Monday, Tuesday, Wednesday, Thursday...
would there be any way for me to leave this automatic weekly date, in the metadata as well as the date and time?

Hi @BrunoAngelo
I'm not sure if I fully understand... what output are you expecting? something like:
Monday 06.03.2023? If so do you want it to be one question(and one answer) like in my example or maybe two answers one for the day of the week and one for the whole date?

If you have a date, you can use a calculate type question and this function to get the day of week:
format-date(date, '%a')
with '%a' defining the output format as short text day (Sun, Mon, Tue…)
and you'll replace "date" with a reference to your date value
more detail in the docs: https://docs.getodk.org/form-operators-functions/#formatting-dates-and-times-for-display

hello, thank you very much for answering, I use this expression that you informed in the XML form or in the "calculation" option in "build.getodk.org"?
I usually use the form builder site because it is easier for those who don't understand much programming language.
in summary, I would just like to add the day of the week eg: "monday, tuesday, wednesday, thursday" through the automatic date in the "metadata" field (which would be the best option in my case) or else in the Date/Time option inside of the form.

yes, I would like it to be like your example.. if you can use the metadata as a basis for calculating the day of the week, it would be perfect, because the user would not need to use a date/time question, understand?
if you can put the expression that I should use and where to use it in the XML I would be very grateful

Here's a working example in XLSForm. We don't suggest authoring a form directly in XML.

format_date.xlsx (8.9 KB)

the xlsx file was better for me to understand..thanks a lot.
I couldn't quite understand the XLSForm format you posted... so... I saw that you used the input type today, can I insert a calculation into a question through ODKBuild? because there I have it easier to assemble the forms than in xlsx.
I saw that in the ODKBuild tool the question metadata -> today does not have an "advanced" option to insert a calculation, the way you exemplified, is the question in the metadata format or in the selectable calendar format?
thank you very much for answering so fast...

Add a metadata type question with "Data Name" = "today" and "Kind"="Today".

Add a text type question with "Data Name" = "format_date" and set "Calculate" to:

format-date(${today}, '%a, %d %b %Y')

The "today" inside the curly brackets is the "Data Name" from the first metadata question.

Your submission data with then have a column called "format_date" with the day of the week included in the text. You can also reference that value in your survey. For example, the label for this text type question includes both the first metadata value and the value after formatting:

today: ${today} and formatted date: ${format_date}

So the form looks like this. The first 2 questions are not shown, they are done in the background. But the results are visible in the label for the question that is shown.