Auto generate week number from date

What is the problem? Please be detailed. Please can you help me get a week number automatically when I select date in a survey?I have an XLSForm which I use to collect survey data. I have date, so when the user select the date, the year is autoclaved and displayed as "18, 0r 19" meaning 2018 or 2019 depending on the date selected. the month is also auto generated from the selected date. I want to Auto generate week number from selected date in an xlsForm to be used in ODK? e.g. when I select 5th 1-7th October, 2018. I want to automatically see this: Year is 18, Month is Oct, Week is Week1 of Oct.
Thank you

What ODK tool and version are you using? And on what device and operating system version? Android platform

What steps can we take to reproduce the problem?

What you have you tried to fix the problem?

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

The first thing you will have to do is decide on a few things in order to make the problem tenable:

  • does your week start on a Sunday or Monday? (or something else!)
  • how do you define the first week of the year? Specifically, ISO8601 defines it as:

"Each week's year is the Gregorian year in which the Thursday falls. The first week of the year, hence, always contains 4 January."

however, that may not be what typical uses expect (eg Week 1 is simply the week Jan 1 falls in).

Thank you so much for the clarification.
I prefer a week that starts on Monday and just the order of the ISO8601.
I want that week to auto generate anytime I select a date in the month.
Thank you.

Just posted a solution to Showcase. Thanks, it was a fun challenge! :slight_smile:

  • Gareth