Format -date resulting an invalid date

Hello kobo team, I am trying to change date format to DD/MM/YYYY from the default YYYY/MM/DD format. I used recommendations from previous discussions in this community; format-date(${my_date}, "%d/%m/%y’). This didn’t work in the form and keeps showing me invalid date. I would appreciate it if you could look at the attached Xlsform. Thank youSLL date-time.xlsx (18.2 KB)

Hello Bizaheran,

I had reviewed your XLSX file and its working fine. But when I preview the the form through browser (enkto). It says invalid date But again I checked the form in the kobo collect its showing the date format is working fine.

Regards,
Dinesh Dongol

1 Like

Thank you, @Dnes, for checking it out with Collect android app and confirming that it works at your end. @bizaheran, I checked the same with Enketo, and it works perfectly for me.

xlsform as seen in the survey tab:

Data entry screen as seen in Enketo:

Data as seen in the KoBoToolbox server:

xlsform:

SLL date-time.xlsx (16.5 KB)

Thank you @Dnes and @Kal_Lam for checking out the form. Yes, it works in the collect. But, the Kobo form preview displayed an invalid date. I have one question though, does this mean I have to keep both questions (the original and formatted)? I was hoping to see only the new formatted date while collecting the data?

Hi @bizaheran
In this case, you just need to keep one format that works in KoBoCollect and Enketo as mentioned by @Dnes and @Kal_Lam respectively. You don’t need the version that works on preview because you never collect data with the preview.

Stephane

1 Like

Thank you @stephanealoo. I think the first question about the invalid date is resolved. To make my question clear, I now see two questions asking the same thing (date) in ODK collect. First comes the question with the MM/DD/YYYY format and then the formatted date follows with DD/MM/YYYY. How do we keep just one, do we hide or delete one of them? wouldn’t this be a duplicate if I keep both?

1 Like

Hi @bizaheran
You can make the question last_c_section2 hidden during data collection. However during data downloads, you will find it in the data set.

Stephane

1 Like

Dear Stephanealoo, how to make it hidden