hustcc / timeago

:hourglass: Simple library used to format datetime with `*** time ago` statement. eg: "3 hours ago".
http://timeago.org
MIT License
224 stars 37 forks source link

Russian locale improved. #25

Closed nmb10 closed 5 years ago

nmb10 commented 5 years ago

Hi. Thanks for useful lib. This PR fixes some incorrect russian cases:

  1. Correct format for (2, 3, 4) cases: before fix:

    >>> for_days_ago = date + datetime.timedelta(days=4.5)
    >>> print(timeago.format(date, four_days_ago, locale))
    '4 дней назад'  # Not correct.

    after fix:

    >>> print(timeago.format(date, four_days_ago, locale))
    '4 дня назад'   # Correct

    The same way for minutes, hours, weeks, months and years.

  2. Correct format for (21, 31, 41 ... ) cases before fix:

    >>> twenty_one_minutes_ago = date + datetime.timedelta(minutes=21)
    >>> print(timeago.format(date, twenty_one_minutes_ago, locale))
    '21 минут назад'  # Not correct.

    after fix:

    >>> print(timeago.format(date, twenty_one_minutes_ago, locale))
    '21 минуту назад'  # Correct

    The same way for seconds, hours and years.

Thanks.

lolobosse commented 5 years ago

Hey,

I merged and released a new version (1.0.10) :tada:

Thank you very much for your time :+1: :ru: :+1: