Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
larryweya opened this issue Mar 18, 2014 · 1 comment
Open

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

larryweya opened this issue Mar 18, 2014 · 1 comment

Comments

@larryweya
Copy link
Contributor

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
Copy link
Contributor

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//issues/115
.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants