arrow icon indicating copy to clipboard operation
arrow copied to clipboard

Brief parameter for humanize function

Open beucismis opened this issue 4 years ago • 7 comments

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

beucismis avatar Jul 03 '21 12:07 beucismis

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

anishnya avatar Jul 03 '21 19:07 anishnya

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

Yes, this is a issue.

beucismis avatar Jul 03 '21 19:07 beucismis

@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.

anishnya avatar Jul 03 '21 19:07 anishnya

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

systemcatch avatar Sep 07 '21 09:09 systemcatch

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.

neelrpatel avatar Nov 29 '21 04:11 neelrpatel

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.

systemcatch avatar Nov 30 '21 17:11 systemcatch

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.

akotha7 avatar Dec 15 '21 17:12 akotha7