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

TimeSpan's should show the time breakdown #29

Closed
robdmoore opened this issue Dec 17, 2013 · 4 comments
Closed

TimeSpan's should show the time breakdown #29

robdmoore opened this issue Dec 17, 2013 · 4 comments
Labels

Comments

@robdmoore
Copy link
Contributor

I would expect this:

var timespan = TimeSpan.FromDays(2) + TimeSpan.FromHours(3) + TimeSpan.FromMinutes(5);

Assert.That(timespan.Humanize(), Is.EqualTo("2 days, 3 hours, 5 minutes"));

But it seems to come back with 2 days currently.

@MehdiK
Copy link
Member

MehdiK commented Dec 17, 2013

Hey @robdmoore,

I see your point and while this is more logical, I think the current implementation might be more desired. This is parallel to DateTime.Humanize and the thinking is that a human doesn't quite care about the minutes when we're talking about a couple of days.

I guess what we could do is to provide an overload that will return the detailed value.

/cc @joshka

@robdmoore
Copy link
Contributor Author

Completely agree - I can think of situations where you would want both. I wonder if we can somehow provide the accuracy you are interested in e.g. hours vs mins vs seconds?

@joshka
Copy link

joshka commented Dec 18, 2013

No real opinion from me.

As a side note, if accuracy matters (it probably does), there should always
be a secondary piece of information that shows the full timestamp.
An example of where this is not done (and frustrates me several times a
week) is the TFS build results views.
E.g. Build logs say finished x minutes ago, even when I have that build
result open in a tab and it's been there for hours. List of results that
have a bunch of builds where the only info is the date, without a time is
also an annoyance.

I wonder if this guidance would be usefully put somewhere nearby to this in
the documentation of these features.

@MehdiK
Copy link
Member

MehdiK commented Jan 23, 2014

Done in #65

@MehdiK MehdiK closed this as completed Jan 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants