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

Filed at https://github.com/opendatakit/xforms-spec/issues/265 since there have been no objections and when a feature comes from an existing spec we usually go straight ahead.

Very useful would love to see it.

1 Like