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

Humanize more human version #1125

Open
Ione03 opened this issue Sep 29, 2022 · 2 comments
Open

Humanize more human version #1125

Ione03 opened this issue Sep 29, 2022 · 2 comments

Comments

@Ione03
Copy link

Ione03 commented Sep 29, 2022

Increased ability to convert to yesterday instead of 1 day ago, or tomorrow instead of in 1 day.
For example :


present = arrow.now() # september 29th (thursday)
past = present.shift(day=1) 
present.humanize(past)  # Tomorrow
past = present.shift(day=0) 
present.humanize(past)  # Just Now, if have second become 10 second ago etc... using existing arrow humanize function
past = present.shift(day=-1)
present.humanize(past)  # Yesterday
past = present.shift(day=-2)
present.humanize(past)  # Tuesday (only get days of week)
past = present.shift(day=-3)
present.humanize(past)  # Monday
past = present.shift(day=-4)
present.humanize(past)  # Sunday
past = present.shift(day=-5)
present.humanize(past)  # Saturday
past = present.shift(day=-6)
present.humanize(past)  # Friday
past = present.shift(day=-7)
present.humanize(past)  # Last Week
past = present.shift(day=-8)
present.humanize(past)  # september 21th (just get date, or use existing arrow humanize function)

I got inspiration from whatsapp app

@nijek
Copy link

nijek commented Oct 10, 2022

Is there anybody working on this? If not I'd like to do it.

@krisfremen
Copy link
Member

@nijek you can give it a shot, I'm working on generating locales off of CLDR, so if you can work within the data and ranges they have, that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants