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

minUnit for DateTime #1227

Open
harvinders opened this issue Sep 29, 2022 · 0 comments
Open

minUnit for DateTime #1227

harvinders opened this issue Sep 29, 2022 · 0 comments

Comments

@harvinders
Copy link

Currently TimeSpan has an extension method to do following

TimeSpan.FromMilliseconds(122500).Humanize(minUnit: TimeUnit.Second) => "2 minutes, 2 seconds"    // instead of 2 minutes, 2 seconds, 500 milliseconds
TimeSpan.FromHours(25).Humanize(minUnit: TimeUnit.Day) => "1 Day"   //instead of 1 Day, 1 Hour

However we don't have something similar for DateTime, say if we want to never show 15 seconds ago but like a minute ago. It would be nice to have an extension method that take minUnit too for DateTime

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

No branches or pull requests

1 participant