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

Dates #43

Open
govuk-design-system opened this Issue Jan 12, 2018 · 6 comments

Comments

7 participants
@govuk-design-system
Copy link
Collaborator

govuk-design-system commented Jan 12, 2018

Also known as: 'Ask users for dates'

Use this issue to discuss this pattern in the GOV.UK Design System.

Anything else

@govuk-design-system govuk-design-system created this issue from a note in GOV.UK Design System Community Backlog (In progress) Jan 12, 2018

@govuk-design-system govuk-design-system moved this from In progress to Published in GOV.UK Design System Community Backlog Jan 12, 2018

@timpaul timpaul added the pattern label May 21, 2018

@gazjoy

This comment has been minimized.

Copy link

gazjoy commented Jul 20, 2018

For the "Year" field should users be able to enter "80" if they were born in "1980" or should there be a minimum length of 4 characters imposed?

@hannalaakso

This comment has been minimized.

Copy link
Member

hannalaakso commented Jul 20, 2018

The GOV.UK Design System does not currently contain any specific guidance about the formatting of years as numbers. The GOV.UK Styleguide does not specifically mention it either but as it only includes examples in the 4 character format so, it would appear safer to do that.

If you have a specific use case where you think there is a clear advantage for collecting years as two digit numbers please add it here as it could definitely be something to include in our guidance.

@joelanman

This comment has been minimized.

Copy link
Member

joelanman commented Jul 20, 2018

It's a good question. As Hanna says we don't currently have published guidance on using 2 digits.

Personally I think it'd be nice to support users who enter 2 digits if it's unambiguous. However I guess there's always the chance that for example if someone enters 30 in year and meant to put it in month. Requiring 4 digits would avoid that.

@stevenaproctor

This comment has been minimized.

Copy link
Collaborator

stevenaproctor commented Jul 20, 2018

I agree with @hannalaakso that it is safer but it is clearer too. There are situations where ‘80’ could mean ‘1980’ or ‘1880’.

@adrianbiskupski

This comment has been minimized.

Copy link

adrianbiskupski commented Nov 7, 2018

What about use of two digit format in case of days / months ? https://design-system.service.gov.uk/patterns/dates/ suggests that there should be a single digit in situations where two-digit would have 0 at the beginning. (ie. 03 07 1999)

@stevenaproctor

This comment has been minimized.

Copy link
Collaborator

stevenaproctor commented Nov 8, 2018

@adrianbiskupski The pattern is flexible so 03 07 1999 and 3 7 1999 should both be accepted. But you should not force leading zero on days and months between 1 and 9.

The leading zeroes are not needed. Like @joelanman said not adding them is "ever so slightly quicker, and more natural - dates in the real world, calendars etc, don't tend to have leading zeroes. It's a 'computery' pattern and we try and stay away from those."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment