Hi all, I'm trying to implement functionality in the date widget with spinner format, and I can't find any information on how to actually edit the widget. What I'm trying to do is to add a value to the day and month drop-downs to indicate that one or both is illegible. Is it possible to do this, or is there another way to implement this functionality that isn't too complicated, gives me one date variable, and doesn't involve converting all of the calendar date variables in my survey to text input fields? Thank you!
I think the spinner appearance might be a device operating system thing?
You can use
relevant directly on a date question, like in this example.
What is your specific use case? For example, you want to make sure the date is between the 15th and 20th of the month or some such?
You may be able to use
relevant, calculations, and form operators for converting dates and time. For example use
format-date(date, format) to pull out just the day of month and numeric month. And then make the user go back to the question.
Thank you for your reply! My brief was actually to add numbers to the drop-down menu, eg an option to select '555' instead of the day or month if either of them are illegible when collecting data from written medical files. I could conceivably create three separate spinner fields and then convert them into a date variable, but that seems an awful lot of work! Currently huddling with my data collectors to try and find a new way to code unclear dates...
With three separate integer or text with
appearance set to
numbers, you could then use a calculate question to
concat() along with forward slashes to get your formatted date value.
So if a day is illegible you want to have 2019-10-555 for example? 2019-555-555 if both day and month are illegible?
Exactly I like danbjoseph's solution but we're collecting quite a lot of date values so I'm concerned about the amount of extra fields and calculations I'd have to add to the form!
I see but it's not possible to avoid calculations here if you use the original ODK Collect, but if you have your own fork you can edit the code responsible for building those spinners.