Humanizer icon indicating copy to clipboard operation
Humanizer copied to clipboard

Refactor DateTime and TimeSpan humanization to use ToQuantityExtensions.ToQuantity to quantify time units

Open MehdiK opened this issue 11 years ago • 6 comments

Brought over from #192

MehdiK avatar Apr 13 '14 12:04 MehdiK

Hi, I am actually working on this and I have doubts about the need. This is what I understood: the aim is to restructure humanization of Datetime to have the same parameters as there in ToQuantity( like ShowQuantityAs.Words). Is that correct? Thanks

alimeziane avatar Apr 12 '15 23:04 alimeziane

Partially covered by #405

hazzik avatar Apr 14 '15 09:04 hazzik

@alimeziane not exactly. The idea was to use Inflector for words as "second", "minute", "hour", etc.

hazzik avatar Apr 19 '15 21:04 hazzik

@hazzik , In the PR #405 , i added the parameter "ShowQuantityAs" to TimeSpan and DateTime humanization , it will select the display mode (numbers or words), for example : TimeSpan.FromDays(15).Humanize(2,showQuantityAs : ShowQuantityAs.Words) --> two weeks , one day DateTime.Now.AddDays(12).Humanize(false,showQuantityAs : ShowQuantityAs.Words) --> twelve days from now

So I think it solves the #290 issue , but I do not see anything added to solve the current issue. If you have an example that would be cool.

alimeziane avatar Apr 20 '15 11:04 alimeziane

So I think it solves the #290 issue , but I do not see anything added to solve the current issue. If you have an example that would be cool.

You're right.

This issue is about internal implementation of time fraction quantification, to remove need of resources

hazzik avatar Apr 20 '15 21:04 hazzik

@MehdiK still think this is worthwhile?

SimonCropp avatar Mar 17 '24 06:03 SimonCropp