SEL-Columbia / pyxform

A Python package to create XForms for ODK Collect.
21 stars 9 forks source link

When a calculation's value is now, set the type to dateTime #115

Open larryweya opened 10 years ago

larryweya commented 10 years ago

The default type is string which results in ODK collect filling in just the date portion of the timestamp. With the value set to dateTime, the timestamp is filled correctly.

<bind calculate="now()" nodeset="/leachate_monthly_register/timestamp_1" type="string"/>

vs

<bind calculate="now()" nodeset="/leachate_monthly_register/timestamp_1" type="dateTime"/>
prabhasp commented 10 years ago

Note: if we want to fix this in pyxform, it would be wise to add a way to over-ride the type of a calculation rather than fix it directly for this one use case (which seems weird).

For example, we could allow people to specify the type of a calculation in the type column. Instead of putting just calculate there (whose type would default to string), they could do calculate dateTime there, or calculate integer there, or what have they. There is already precedent for this in the language, with select_one CHOICE_LIST being specified, which creates a specific kind of select_one, or with select_one choice_list OR_OTHER.

On Tue, Mar 18, 2014 at 8:42 AM, Larry Weya notifications@github.comwrote:

The default type is string which results in ODK collect filling in just the date portion of the timestamp. With the value set to dateTime, the timestamp is filled correctly.

vs

Reply to this email directly or view it on GitHubhttps://github.com/SEL-Columbia/pyxform/issues/115 .

Prabhas Pokharel http://prabhasp.com US mobile: +1 347 948 7654 twitter/skype/facebook/whatever: prabhasp