-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add new function roundToNearestMinutes #928
Conversation
46d79c9
to
dd4f96e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Thank you a lot!
The PR was released as Thank you for your great work! |
this is very limited just 1 to 30 minutes. What about 33 minutes ? |
@dcrystalj please elaborate your use case for rounding to 33 minutes. Regarding the seconds, hours, whatever, the function is called |
@kossnocorp sorry my point was just that we need more generic function. I would expect of this fn to work if I give it roundToNearestMinutes(date, 120) same as roundToNearestHour(date, 2) RIght now in my project I need function to round to nearest hour, 3 hours, day and 3 day... Maybe we should just open issues to implement |
@dcrystalj yeah, that makes sense. Feel free to open those, but also send PRs. |
@kossnocorp if you file a separate issue I can try to work on it. Thanks for the feedback. |
Fixes #787