In C# I am using Humanizer and need to know how many Months, Weeks, Days and Hours are in a TimeSpan in a decreasing amount. Basically the duration of the timespan in decreasing units.
For example:
var z = myTimeSpan.Humanize(???);
I would like z would be "3 Months, 2 Weeks, 3 Days, 4 Hours"
It doesn't appear to be possible to make Humanizer display months and weeks. Based on the source code that @RufusL linked, this seems to be intentional.
You could do get months, days, and hours, like so:
Or you could do some post-processing with regex (it's kludgey, and doesn't work for other locales, so I can't fully recommend the approach):