It sounds simple, but still I am not sure how to do it:
To record her activities a user needs to enter two timestamps:
when did I start with an activity?
when did I finish the activity?
This data is not entered right when the activity is performed but sometime later.
Timestamps are used to:
calculate the duration of the activity
filter activities for views and reports (eg “all activities that started between 9:00 and 10:00”)
It sounds simple, right? Just add two date entry fields to a form and be done.
But here’s the catch:
the date entry fields are not so easy to use while using the app on your smartphone with one hand
two date entry fields means entering the date twice (if recording an activity from another day than today)
the timestamps are recorded with the UTC timezone. That’s no problem for display, but for calculation. Example: While in Berlin the timestamp “29.9.23 00:30” is recorded; what gets stored is “28.9.23 23:30” (or even “28.9.23 22:30”). Now, when I want to filter all activities of the 29th this one does not show up. (At least I had trouble with consistent results when accessing date fields in calculated columns, eg Excel, JS.)
What to do? Am I missing something?
My current idea is to split date and time collection.
set the date only once
then enter two time values
I’d like to preset the date to today; but it should be easy to change it to yesterday’s.
Time values are only relevant in 15min increments. I’m thinking about two choice entry fields:
one with all hours (0…23)
one with the minute values (0, 15, 30, 45)
But then I’d need to fuse all this together into two date/time values for the actual timestamps, I guess. How best to do that? Using a JS field or a template?
Maybe get the date selected with a choice “today” or “yesterday” (I don’t think activities are logged further back in the past.)
Set a starting time using choices for hours and quarters.
Set duration instead of an ending time using choices for hours and quarters. (Would mean one value less to enter/select.)
And then extract the date from the date choice, eg “2023-09-29”, and add to that the starting time choices, eg “2023-09-23T10:45”, and then get it transformed from a string into a proper date/time value. (Do (almost) the same for the finishing timestamp.)