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

Locale FI - breaks from other languages in relative time format #2589

Open
sergioisidoro opened this issue Feb 23, 2024 · 0 comments · May be fixed by #2590
Open

Locale FI - breaks from other languages in relative time format #2589

sergioisidoro opened this issue Feb 23, 2024 · 0 comments · May be fixed by #2590

Comments

@sergioisidoro
Copy link

sergioisidoro commented Feb 23, 2024

Describe the bug
In FI locale, the relative format replaces the numeral with a word, when the number is less than 10

  if (number < 10) {
    return result.replace('%d', words.numbers[number])
  }

Like: kahdeksan kuukautta sitten

https://github.com/iamkun/dayjs/blame/2076da970047c6e0a22c8d4243a42d52833a5df2/src/locale/fi.js#L35

This is highly inconsistent with the examples that are given on any other language ( https://day.js.org/docs/en/display/from-now ), and does not seem to be a specific instrument or requirement of the language, but a stylistic choice (ie, 1 vuoden päästä is understood as yhden and not yksi, given the context.)

The main drawback of the previous approach is that it takes a lot of space with numbers like 8 and 9 (kahdeksan and yhdeksän). Especially when coupled with kuukautta sitten it starts to limit the usability in certain UI elements given the space it needs (eg. mobile interfaces)

Expected behavior
The FI locale should output roughly the same format as mentioned in the documentation - https://day.js.org/docs/en/display/from-now - using numerals rather than spelling out the number.

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 a pull request may close this issue.

1 participant