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

Please fix declension in relative time #610

Open
VBagmut opened this issue Jun 6, 2019 · 2 comments
Open

Please fix declension in relative time #610

VBagmut opened this issue Jun 6, 2019 · 2 comments

Comments

@VBagmut
Copy link

VBagmut commented Jun 6, 2019

Describe the bug
Thanks for fixing #577. But I found another bug. This time with relativeTime plugin.

Expected behavior
It is incorrectly using declension. For example: "2 dayjs ago" needs to be "2 дня назад" but instead shows "2 дней назад". How it needs to be described here http://www.unicode.org/cldr/charts/28/supplemental/language_plural_rules.html#ru
I hope you will fix this and then I'll be able to throw away heavyweight momentjs. Because now I need to use moment for this cases.

Information

  • Day.js: 1.8.14
  • OS: Ubuntu 18.04.2 LTS
  • Browser: Google Chrome 74.0.3729.169 (Official Build) (64-bit)
  • Time zone: GMT+03:00
@moosemanf
Copy link

Same in German...

altough it's elegant in english, it is not possible in german:

d.en.relativeTime = {
    future: 'in %s',
    past: '%s ago',
    y: 'a year',
    yy: '%d years'
  }
  if (withoutSuffix) return out
    return ((result > 0) ? loc.future : loc.past).replace('%s', out)

we would need (for example) a yy for withoutSuffix == true and another yy for withoutSuffix == false

withoutSuffix

3 Jahre

withSuffix

vor 3 Jahren

#304 there is a good starting solution, but unfortunately no progress...

@stalkerg
Copy link

stalkerg commented Nov 8, 2019

I am also interested in that feature. It's completely unnatural for Slavic languages (and rule a little bit more complicated than in English).

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

No branches or pull requests

3 participants