ODK XForm Spec Proposal: add week number to format-date() and format-date-time()

I'd like to propose adding a %W identifier to the XPath functions format-date() and format-date-time() to return the week number as specified under ISO 8601.

The %W identifier was copied from an another implementation in Python.

This is a sample JS implementation: https://www.epoch-calendar.com/support/getting_iso_

Some Enketo users have expressed interest in this functionality. It is relatively minor and probably not controversial.

cc @LN, @Xiphware

That sounds good to me! My preference would be to base it off XPath 3.1 which by default outputs an integer. The Python function you point to outputs a 0-padded 2-digit decimal.

1 Like

Ah, I forgot to look at XPath specs... Thank you! I agree to use that as that as the spec for this %W identifier addition.

FWIW, I likewise agree with proposal, and using XPath 3.1 spec thereof.

1 Like