1. What is the issue? Please be detailed.
I have a multilingual form with two datetime questions to be filled out by enumerators. They are essentially a start and a stop time for a timesheet showing what activity they were doing during that time. I would like to calculate the difference between these datetimes as well as display that difference in number of Hours and Minutes to the enumerators after they complete both questions.
I think there is an issue with the int() operator on a datetime value in English. ${calc_minutes_total_disp} and ${calc_hours_disp} are not displaying properly as labels in English in ODK Collect v2024.3.0 Beta 7 and Enketo even though when submitted, the values submitted /in the database are the correct ones, the same as the ones that show up in the other languages.
2. What steps can we take to reproduce this issue?
Use the attached XLSForm via Collect or Enketo and put in times that are different and then change languages from English to the other two. English is the only one that isn't displaying ${calc_minutes_total_disp} and ${calc_hours_disp} correctly.
3. What have you tried to fix the issue?
I tried what was recommended by @Mauricio_Andres_Arci here
int((decimal-date-time(${time_end})-decimal-date-time(${time-start}))*24*60)
I also tried what was recommended here
Essentially I'm wanting to do a rounddown() function, which seems like is not actually a function and instead posts like this are recommending to convert using int() but that isn't functioning properly.
4. Upload any forms or screenshots you can share publicly below.
TimeDate_Example.xlsx (11.9 KB)
I should note I saws several posts about constraints for timedate questions, and I should note this form shows two examples, one where the start time constraint is non future (must be now or in the past). The second, end time, must be non future AND is after the start time as mentioned here. I struggled for a bit trying to using things like:
. <= date(today())
. <= date(now())
which didn't fully work.