-
Notifications
You must be signed in to change notification settings - Fork 3
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
Time input #173
Comments
Research with patterns team (Temporary event notice prototype)The patterns team included a basic time entry - we didn’t do significant work on the design, but were interested in how users used it, and will use the findings for future patterns. Our pattern looked like this: This design did not test well. In the scenario, participants were told they were working on an event from 6pm to midnight
Some takeaways for a future design:
|
We're thinking about using the native time input when users are browsing on mobile and something similar to the date input when people are using desktop (Hour input, minute input select am or pm). Has anyone ever thought about doing something similar for mobile users? Wondering how accessible mobile native input is? |
Noticed this pattern isn't listed on the backlog page. Can it be added? |
We (School Experience) came across this too. I'm leaning towards just using the standard inputs and providing a polyfill - see a demo here. Yes, a polyfill isn't ideal, but it's only IE11 and (desktop) Safari amongst the commonly-used browsers that don't support it. |
We (Content Publisher) have gone with a dropdown + type approach. This was to give users the ability to set more detailed times, but remove the higher risk of error by having it as an open text field, especially if a user inputs the wrong time (for them) but in a technically valid format. A few considerations:
|
@soniaturcotte I mentioned this in a slack channel but I'll repeat it here for the benefit of github users. Did you test it with a space character to the left of 'am' or 'pm'? |
We didn't, but I can't imagine it would make a great deal of difference. |
Thanks. I think it's better without a space. This is consistent with how to display units of measure e.g. '11 kg', some style guides, and this article: If we create guidance on Design System, I propose:
I'd like to see 24 hour format mentioned as an option if supported by evidence. |
@terrysimpson99 The GOV.UK style guide doesn't use spaces between the number and am/pm: |
Oh yes. Thanks for pointing that out. I'll suggest the change over there. |
I can't find a github for https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#times Does anybody know what the mechanism is? |
Considering that all of GOV.UK has been using the style guide without a space, I’m not sure a change is warrented. What value do you think it would add ? |
It doesn't add significant value. GDS style isn't static and is made up of many small pieces of guidance which don't add much value individually and some of which have changed. I was just sharing my thoughts on how to make it better. I know the mechanism for commenting on patterns but I don't know the mechanism for commenting on the style guide. Does anybody here know? |
@terrysimpson99 this is the place to send feedback about the GOV.UK style guide or content design guidance. |
Thanks. Done. |
The only guidance I'm aware of is: '5:30pm (not 1730hrs)'. See: https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style That guidance doesn't merely express a preference or a default for the 12 hour clock. It's expressed as a ban on the 24 hour clock. Meg suggests the 24 hour clock is appropriate for customs users, it is normal in transport, healthcare, police, fire. There are a variety of ways to write guidance and that particularly piece of guidance is more emphatic than it needs to be. The guidance should be changed to eliminate the ban. |
We have now changed the time display on our service to the 24 hour clock to match our 24 hour time input. Our research showed that this is what the users are used to, and want, and it seems sensible to adhere to the industry standards. We are always playing back 4 digits, with a colon (e.g. 23:59, 02:01). |
Is this component still in use? We are looking at an option like this with our service re: inputting optional time and would want to bring in the same code. |
Thanks @danallenhmrc. Did you gain any insights into 12 hour clock confusions related to the two hours 1200-1259 am and 1200-1259pm? For example people will say something like 'We have a 1 hour meeting which runs from 1130am to 1230am'. |
@terrysimpson99 from what was shared with me, our users are more familiar with the 24 hour clock (transport industry, Europe) so no such insights I'm afraid |
Here’s how the Manage teacher training service asks for time, when scheduling an interview with a candidate: It uses:
A space, full stop or colon can be used between hours and minutes. The hours do not need to be zero-padded There was also some debate about whether 24 hour times past midday should be accepted ( See time input in the design history for the service. |
@frankieroberto This looks nice and simple from a UI perspective but do you have an example of the validation/regex on this? Is this being used in a live system? Thank you |
@frankieroberto @anandamaryon-gov I used a similar pattern to ask for time on a project with the British Red Cross with some success (unfortunately not visible to the public) but I ended up creating a simple dependency-free package on the back of it that parses time from a range of different inputs that's quite forgiving: https://www.npmjs.com/package/user-time We then just show that time back to the user for them to confirm we've interpreted their input properly. |
I propose any solution allows designers to specify:
I also propose
I'm open to debate on how many digits are mandatory in each version |
@terrysimpson99 I don't think you can have both a lack of a leading zero and not having a colon. You need one or the other to be able to read a time. I think to be robust we'd want to enforce a separator - and if not be very careful in validation. Examples: Please let me know if I've misunderstood your suggestion and my examples don't apply. |
A lack of leading zero should be interpreted the same as if a leading zero were present prior to the first digit. Q. 112 - is this 1:12 or 11:02 or 11:20? I would always interpret 112 the same as 0112 and 01:12 However I do agree it looks a bit odd. I was thinking more of '7:00' Q. 12 - is this 12:00 or 1:20 or 1:02 I would always interpret 12 the same as 1200 and 12:00 Specifying a colon is additional user effort because it requires a shift key on UK keyboards and is not immediately available on mobile keypads. It's worth noting that ISO 8601 does not require a separator so 23:59 and 2359 are both valid expressions. |
Hiya - Have you, or anybody in the blog done any accessibility testing on this pattern?! I like the solution, but Im concerned that its a very long dropdown and with so many options, it could represent an accessibility issue - but I am not a pro, so I am just curious to understand if anybody has some info. Thanks |
As @frankieroberto shared above, in the ‘Manage teacher training applications’ we designed a single input for time. While we were conscious at the beginning to forgive trivial mistakes we did further analysis and found we could allow a wider range of input formats for interview time. |
There's a conflict:
See also: https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight |
@terrysimpson99 thats a style guide for what we publish, not the input we accept from users. |
@adamsilver You mentioned https://bat-design-history.netlify.app/manage-teacher-training-applications/allowing-a-wider-range-of-input-formats-for-interview-time/ I see it says user input of '12' will be interpreted as '12am'. Can you confirm that? |
If '12' will be interpreted as '12am' then * @cristina-agramunt 's comment "We also accept 24hour time if users input it in correctly" is not true. |
Thought I'd share error messages I've used when asking for time input before as this isn't covered in current error message guidance. This is based on 2 field input where one or both fields are missing (and it's a mandatory field) or you are only accepting either 12 hour or 24 hour clock inputs and the input isn't valid. 12 hour clock 24 hour clock Not yet tested with users. |
Gonna toot @adamsilver's horn before he gets a chance, but he wrote up a pretty nice blog post on designing time inputs here: https://adamsilver.io/blog/designing-a-time-input/ |
We've just added some guidance on how to 'share findings about your users' with us 📝. This will help us learn more about how your users input time within your service. |
What
A pattern for your users to specify a time or time period.
Why
It's potentially quite common for booking appointments, recording events, applying for licences
Related: Date input
The text was updated successfully, but these errors were encountered: