OpenDataKit – entering dates in Ethiopian format

Some of the feedback we had from the initial HEW training last week was that some of the HEWs had difficulty in using the Gregorian calendar. Ethiopia has it’s own calendar which is the normal calendar used for the vast majority of Ethiopians (Ethiopian calendar entry on Wikipedia). Given that we’re asking the HEWs to collect date information, we need to make this as easy and understandable for them as possible – for example, to enter appointment dates a few weeks or months in advance. So over the past couple of days I’ve been looking at creating a date picker widget for integration into ODK Collect that will allow dates to be entered using the Ethiopian calendar format, but will store the date in the database as Gregorian. This transformation is hidden from the user and storing Gregorian dates in the database means we can manipulate and compare dates for reporting purposes, which we’d be unable to do storing Ethiopian dates as strings in the database (we can transform the dates back into Ethiopian calendar for final display).

It ended up being much more straightforward than I though it would be, especially with much help from the ODK Community and with the Joda Time java library already built into ODK Collect. I’ve got a first version ready for testing, so if anyone else is interested in having a look you can download the .apk file for installation on your Android phone.

To see the Ethiopian date picker working you’ll need to load up a form which specifies data picker. You can connect to our ODK Aggregate server at: http://hew-datacollect.appspot.com and download the EthioDateTestV1.5 form. Or you can download the original form XML to put on your own server.

This is only a first version, so any feedback is very welcome – or if you’d like the source code then please feel free to contact me (will put it up somewhere once I’ve tested it a bit more). [Update 19-Aug-11: I’ve now put all the code up as a clone on Google Code at https://code.google.com/r/alextlittle-dc-odk/, so you can see the full changes I’ve made.]

Finally, here are a couple of screenshots of the Ethiopian date picker running in my Android emulator:

Scroll to top