arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.7k stars 673 forks source link

Czech/Slovak Locales Humanize Error When Zero Delta #1078

Closed anishnya closed 2 years ago

anishnya commented 2 years ago

Issue Description

The Czech and Slovak locales fail when using Humanize on a delta of zero. See the following example below.

arw = arrow.Arrow(2000, 2, 18, 1, 50, 30)

past = arw.shift(minutes=0, days=-1)

past_string = past.humanize(
         arw, locale='cs', granularity=["minute", "day"]
       )

I suspect this is due to the fact that typically humanize when it sees a zero delta, defaults to the plural timeframe (i.e second vs seconds). This causes an issue for these locales since the "zero" string for a timeframe is located in the non-plural timeframe unit within the timeframe object.

System Info