Skip to content

Missing weeks when humanizing TimeSpan with min/maxUnit #862

@SystemKeeper

Description

@SystemKeeper

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions