-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
From [the Guardian and Observer style guide: T][T] > times > 1am, 6.30pm, etc; 10 o’clock last night but 10pm yesterday; half past two, a quarter to three, 10 to 11, etc; 2hr 5min 6sec, etc; for 24-hour clock, 00.47, 23.59; noon, midnight (not 12 noon, 12 midnight or 12am, 12pm). [T]: https://www.theguardian.com/guardian-observer-style-guide-t
0170e8c
to
3b81429
Compare
@@ -72,7 +72,7 @@ describe('timeAgo', () => { | |||
const yesterday = new Date(Date.UTC(2019, 10, 16, 3, 0, 0)).getTime(); | |||
|
|||
expect(timeAgo(yesterday)).toBe('1d ago'); | |||
expect(timeAgo(yesterday, { verbose: true })).toBe('Yesterday 3:00'); | |||
expect(timeAgo(yesterday, { verbose: true })).toBe('Yesterday 3.00'); |
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 style guide seems to suggest this should omit the minutes and opt for Yesterday 3
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.
i'd be interested to know what UX think. intuitively it feels like we have multiple use cases here. a journalist writing "yesterday at 1am" seems very different to a status of "15.00". the .
though def seems to fit the style guide.
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.
do you want to add reference and link to the style guide at the top of the file too?
@@ -72,7 +72,7 @@ describe('timeAgo', () => { | |||
const yesterday = new Date(Date.UTC(2019, 10, 16, 3, 0, 0)).getTime(); | |||
|
|||
expect(timeAgo(yesterday)).toBe('1d ago'); | |||
expect(timeAgo(yesterday, { verbose: true })).toBe('Yesterday 3:00'); | |||
expect(timeAgo(yesterday, { verbose: true })).toBe('Yesterday 3.00'); |
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.
i'd be interested to know what UX think. intuitively it feels like we have multiple use cases here. a journalist writing "yesterday at 1am" seems very different to a status of "15.00". the .
though def seems to fit the style guide.
Co-authored-by: Alex Sanders <[email protected]>
🎉 This PR is included in version 4.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does this change?
Fixes the time separator for the
withTime
method.Why?
From the Guardian and Observer style guide: T