Skip to content

Changes to last year format - #133

Merged
koddsson merged 2 commits into
masterfrom
changes-to-last-year-format
Jan 16, 2020
Merged

koddsson merged 2 commits into
masterfrom
changes-to-last-year-format

Conversation

@koddsson

Copy link
Copy Markdown
Contributor

This change increases the month cutoff from 12 to 18 months meaning that months > 12 < 18 will be displayed as 'x months ago' instead of 'last year'. Months >18 will be displayed as 'x years ago'.

This is to prevent 'last year' showing up in January 2020 and you are viewing a <time-ago> element set to November 2018. Since it's more than 12 months we'll round it down to 1 year, parse it as a years ago and Intl.RelativeTimeFormat will format it as 'last year'.

Ref: https://github.com/github/github/issues/132315

@koddsson
koddsson requested a review from a team January 15, 2020 11:37

@keithamus keithamus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I think 18 months is a good cutoff.

@koddsson
koddsson merged commit ad7c3be into master Jan 16, 2020
@koddsson
koddsson deleted the changes-to-last-year-format branch January 16, 2020 13:42
@koddsson koddsson mentioned this pull request Jun 1, 2020
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

Successfully merging this pull request may close these issues.

2 participants