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

Missing weeks when humanizing TimeSpan with min/maxUnit #862

Open
SystemKeeper opened this issue Oct 6, 2019 · 3 comments · May be fixed by #884
Open

Missing weeks when humanizing TimeSpan with min/maxUnit #862

SystemKeeper opened this issue Oct 6, 2019 · 3 comments · May be fixed by #884

Comments

@SystemKeeper
Copy link

Please have a look at the following example

Dim Date1 As Date = #2019-10-06#
Dim Date2 As Date = #2019-12-31#

Dim Diff = Date2.Subtract(Date1)

Dim Str = Diff.Humanize(precision:=3, maxUnit:=Humanizer.Localisation.TimeUnit.Month, minUnit:=Humanizer.Localisation.TimeUnit.Day, culture:=New CultureInfo("en-US"))
Console.WriteLine(Str)
Console.ReadLine()

This outputs

2 months, 25 days

but I would expect something like

2 month, 3 weeks, 4 days

Am I missing something here?

@AKTheKnight
Copy link
Contributor

This is the same as the issue here: https://stackoverflow.com/questions/56550059/humanizer-months-weeks-days-hours

I've started fixing it in #831 but didn't manage to get round to properly finishing it. I'll get on that now :)

@AKTheKnight
Copy link
Contributor

Just to add I'm making a new PR for this, #831 was too far behind for me to want to actually keep active.

@AKTheKnight AKTheKnight linked a pull request Nov 23, 2019 that will close this issue
@chriszuercher
Copy link

What is the status of this? It would be really good to have this as only days are not really user firendly.

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

Successfully merging a pull request may close this issue.

3 participants