Skip to content
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

Timeago: don't use "and 12 months" #5259

Open
mjourdan opened this issue Jun 10, 2024 · 2 comments
Open

Timeago: don't use "and 12 months" #5259

mjourdan opened this issue Jun 10, 2024 · 2 comments
Labels
blocked Blocked via upstream or elsewhere enhancement New feature or request

Comments

@mjourdan
Copy link

Is your feature request related to a problem? Please describe.

Calendar date rounding looks a bit weird today. The same day of the year is rounded in all kind of different ways, like:

  • X years and 11 months
  • Y years and 12 months
  • Z years

Describe the solution you'd like

Consistent rounding results for the whole page would look much nicer. Something like either one of these depending on the number of days:

  • Z years
  • X years and 11 months

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

For instance, the RHEL page shows the following:
image

@mjourdan mjourdan added the enhancement New feature or request label Jun 10, 2024
Copy link

welcome bot commented Jun 10, 2024

Thank you for opening your first issue here 👍. Be sure to follow the issue template if you chose one.

@captn3m0
Copy link
Member

We use the jekyll-timeago gem to generate relative times. Our configuration is the following:

# jekyll-timeago plugin configuration, see https://github.com/markets/jekyll-timeago
jekyll_timeago:
# Use 2 terms in relative timestamps:
# [YES] x years, y months
# [YES] x months, z weeks
# [NO] x years, y months, z days
depth: 2
# Give approx times in relative time
# within a 10% error margin
# See https://github.com/markets/jekyll-timeago/pull/24
# for what this does
threshold: 0.1

There isn't a configuration option that prevents "X years and 12 months" from happening, or even "1 month and 4 weeks". I've filed markets/jekyll-timeago#39 to track this upstream.

Marking this as blocked upstream for now, and we can look at closing once upstream supports this.

@captn3m0 captn3m0 added the blocked Blocked via upstream or elsewhere label Jun 17, 2024
@captn3m0 captn3m0 changed the title Improve date rounding Timeago: don't use "and 12 months" Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked via upstream or elsewhere enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants