arrow-py / arrow

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

Brief parameter for humanize function #1001

Open beucismis opened 3 years ago

beucismis commented 3 years ago

Feature Request

This parameter is False by default. When true, it shortens the date and time terms. For example:

>>> present = arrow.utcnow()
>>> shift = present.shift(hours=2, minutes=34, seconds=56)
>>> shift.humanize(present, brief=True, only_distance=True)
>>> 2h 34m 56s
anishnya commented 3 years ago

I think this is a nice feature to add. Only issue I see is the fact it needs to be supported by multiple locales.

beucismis commented 3 years ago

Only issue I see is the fact it needs to be supported by multiple locales.

Yes, this is a issue.

anishnya commented 3 years ago

@jadchaar @systemcatch @krisfremen what do we think? I would prefer we have at least 10 locales that can support this feature before we implement it.

systemcatch commented 3 years ago

I like it, but would some locales not have shortened forms?

neelrpatel commented 2 years ago

Hi! @akotha7 and I would like to work on this. We aim to have the functionality supported by at least 5 locales for now. Please let us know if there is anything we should know.

systemcatch commented 2 years ago

Hi @neelrpatel, I think for this kind of work we need a spec detailing how this will work and what locales will be supported. i.e. expected inputs and outputs, how locales that don't support this respond.

akotha7 commented 2 years ago

Hi @systemcatch and @anishnya! I've put up a PR for this issue. I added tests and documentation as well, and would love feedback on locales and edge cases I mentioned in the PR.