-
Notifications
You must be signed in to change notification settings - Fork 0
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
Auto-fill "Collection time" with a "Set to right now" button ? #212
Comments
Thanks for bringing up the timezone aspect, @simroux. I am just passing through while reviewing the squad board. The schema currently neither infers—nor requires the submitter to say—a timezone for collection_date, although it does allows for one to be indicated in the submitted value. I think is a problem in the schema, because a date is a timezone-dependent value in reality (e.g. the same real world instant of time might be late on 1/2/2025 in California while being early on 1/3/2025 in New York). I'll file a ticket in The schema does specify a timezone—always UTC—for collection_time, though. |
It's tricky because, as ISO 8601 suggests, there's no such thing as a date with a timezone attached. A date -- on its own -- doesn't indicate any particular instant in time and therefore timezones don't apply. But once you join a date and a time into a datetime, then the timezone matters. When you convert a datetime from one timezone to another the date might change, making it seem like a date could be subject to a timezone.
|
I was thinking only of the field "collection time, GMT" (per the soil template), but I think this field may need some review/work anyway (the regular expression seems to imply some hours/minutes/seconds, but the examples are "813", and "48835"). Also looks like I missed the "GMT" info the first time, but I guess then what we could try is maybe to have a button that "set to current time (GMT)", and then in the display we also add the timezone info (i.e. "GMT") next to it, e.g. "2:18:11 am GMT" ? That way as a user taking a sample at 4pm, I may be confused initially why "set to now" would enter 2am, but if it's clearly labeled "GMT" on the button itself and after in the field value, then I'd be "oh right, ok". |
That's a bug and was fixed as part of microbiomedata/submission-schema#284. The app will inherit that change after the next production release (scheduled for Feb 3) |
I'm going to add this to the submission portal board as well. Same problem to settle there. |
This would be a similar UI as "Set to today" for "Collection Date" except it would set "Collection Time" field to the current time (in the right format and the right time zone).
Not sure how to deal with the fact that the timezone we ask for may not be the time zone of the user, so either auto-convert to UTC (which may look confusing) or make sure the schema also accepts time zone info (but then auto-fill would be even more helpful as that'd be one more unusual data to enter in a controlled format that may be confusing for users)
The text was updated successfully, but these errors were encountered: