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

Create filter / macro for outputting dates #170

Closed
edwardhorsford opened this issue Apr 13, 2016 · 8 comments
Closed

Create filter / macro for outputting dates #170

edwardhorsford opened this issue Apr 13, 2016 · 8 comments

Comments

@edwardhorsford
Copy link
Contributor

GOV.UK has a specific date format to use - let's make a filter / macro that outputs a nice GDS styled date.

A typical date would be: 3 February 1990

  • no leading zero on day of month
  • no rd or similar after day of month
  • month name spelt out in full.

Ref: https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#dates

@paulmsmith
Copy link
Contributor

PR made: #171 Let me know what you think. :)

@paulmsmith
Copy link
Contributor

I've updated my PR to actually remove my initial formatDate filter after discussion with @joelanman. I think its correct we have one PR to formalise how we're adding filters and custom filters to the kit, and then use that as a basis for doing PR's with proposed custom filters (such as outputting formatted dates) should we find there is a user need.

@joelanman
Copy link
Contributor

thinking of closing this - is this definitely a common need?

@edwardhorsford
Copy link
Contributor Author

I feel like nearly every prototype I've made has needed a GOV.UK styled date. I presume others the same. I might question whether a filter would get used though - we have an issue with discoverability.

@joelanman
Copy link
Contributor

what kind of situation would a filter have been useful? I haven't had to deal with many dates in my prototypes

@edwardhorsford
Copy link
Contributor Author

Many services will ask for dates of birth. Those dates will need to be displayed in a GOV.UK format on the check your answers page.

@paulmsmith
Copy link
Contributor

I've had to deal with dates in many of my prototypes and have used filters for displaying them in the correct format.

This would get my vote.

@NickColley
Copy link
Contributor

Since this issue has not seen activity for a while and there does not seem to be a clear need, I'm going to close this out for now and we can re-open if we see something come up.

Thanks everyone.

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

4 participants