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

Humanizing a DateTime using calendar app format #1242

Open
lonix1 opened this issue Nov 29, 2022 · 1 comment
Open

Humanizing a DateTime using calendar app format #1242

lonix1 opened this issue Nov 29, 2022 · 1 comment

Comments

@lonix1
Copy link

lonix1 commented Nov 29, 2022

From a question on SO without resolution:

I need to humanise an historical DateTime to a string that one typically sees in calendar apps, e.g.:

  • 13:40
  • 00:19
  • yesterday
  • Wed
  • Mon
  • last week
  • two weeks ago
  • four weeks ago
  • last month
  • two months ago
  • July
  • February
  • last year
  • 2020
  • 2019
  • etc...

Can Humanizer do this?

(If I must write new code, are there bits in the library which could help me so I don't need to start from scratch?)

@lonix1
Copy link
Author

lonix1 commented Nov 29, 2022

Note the library doesn't give all these formats "out of the box". For example, it may give "16 days ago" whereas I want "2 weeks ago", and it may give "3 days ago" whereas I want "Tue". By default, it does not output all of the above formats, so I'd like to know whether I can configure it to do so?

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

No branches or pull requests

1 participant