Open chrimesdev opened 2 years ago
This would help prototypes (and therefore services) meet the Dates guidance:
As far as possible, spell out months in full. Screen readers read out shortened months (Jan, Feb and so on) in inconsistent and sometimes confusing ways.
Good idea @chrimesdev 👏🏻
That code looks like something I wrote up for the app prototype ages ago. So I am sure there's a smarter way of writing it. The reason we wrote it was we were redesigning the appointment booking service.
We constantly needed to convert what was inputted into dates and reflected back to the user. So we needed the filter. It saved a load of code in each template file.
https://github.com/GrilloPress/contact-preference/blob/master/app/filters.js#L165
Description
For the formatting of dates on the check your answers page in a prototype, I came across this this useful Nunjucks filter to change a number, like 1 "12" or 04, to a month in words: https://github.com/nhsuk/permission-to-contact-prototype/blob/master/app/filters.js#L12
I think this would be useful adding to main prototype kit?