-
Notifications
You must be signed in to change notification settings - Fork 0
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
style: changed date formatting and pr fixes #176
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Co-authored-by: Josh Miller <[email protected]>
Co-authored-by: Josh Miller <[email protected]>
components/Content/Article.jsx
Outdated
@@ -22,20 +23,21 @@ const Article = ({ article, href, showReadTime, showDate }) => { | |||
|
|||
const { title, datePublished, readTime } = article.attributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { title, datePublished, readTime } = article.attributes; | |
const { title, datePublished: unFormattedDatePublished, readTime } = article.attributes; |
month: 'long', | ||
year: '2-digit', | ||
}; | ||
const formattedDate = newDate.toLocaleDateString('en-GB', options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const formattedDate = newDate.toLocaleDateString('en-GB', options); | |
const formattedDate = newDate.toLocaleDateString('en-US', options); |
as we use American english, afaik the order of the day and month is different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm I think GB works better as it displays it as 11-Nov-24 instead of Nov-28,-24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the replace call below makes this weird
would remove the -
replacement, and set as en-US, not 100% on product preference, but US > GB in market share
-
dates tend~ to be for numeric dates
minor either way, clock still ticks haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work, thanks @atepem 🥳
Proposed changes
Screenshots/Recordings
Before:
After: