consumerfinance.gov
consumerfinance.gov copied to clipboard
Strip leading zeros on dates
One place in the code stripped the leading zero from the date. We don't do this anymore with https://github.com/cfpb/cfgov-refresh/pull/871, but should we? Should the dates be NOV 02, 2015 or NOV 2, 2015?
cc @schaferjh @duelj @ajbush
Hmmm. The main reason I can think of for keeping the leading zero is for uniform spacing.....but that doesn't seem like it should be more important than legibility, and I definitely think the date is more legible without the 0. After looking at the examples in #871 I'm pro-getting rid of the 0.
Any other opinions?
This is still an issue on the blog and elsewhere probably, but could likely be solved by copying the work done in https://github.com/cfpb/cfgov-refresh/pull/3204
Discussion in https://github.com/cfpb/cfgov-refresh/pull/3240 came to the likely conclusion that a wrapper around strftime would be what is needed to fix this.
See the "dates and date ranges" section in the content strategy doc linked via https://[GHE]/UX/Content-Strategy for background on date styles.
@anselmbradford During the Careers project, we added some date formatting options (PR here) to strip leading zeros and use standard English month abbreviations. We restricted their application to the Careers section, but they could also be used (or adapted) for other parts of the site. They probably need some usage documentation, though...
Another example, https://www.consumerfinance.gov/coronavirus/mortgage-and-housing-assistance/ has Page last modified: July 06, 2021 at the bottom of the page.