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

Added support for ceil and floor in roundToNearestMinutes #3091

Conversation

Balastrong
Copy link
Contributor

This PR fixed #3063

Added an optional field to options on roundToNearestMinutes to toggle between Math.floor and Math.ceil, with default on floor.

@tan75
Copy link
Contributor

tan75 commented Jul 10, 2022

@Balastrong
normalizeDuration is this a new function? where is this used?

tan75
tan75 previously requested changes Jul 10, 2022
Copy link
Contributor

@tan75 tan75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good idea 🙏
Please change this function to use the existing rounding options.

src/types.ts Outdated Show resolved Hide resolved
@Balastrong
Copy link
Contributor Author

@Balastrong normalizeDuration is this a new function? where is this used?

Ah I was doing some research for #3092 but I didn't mean to commit them on this branch, I'll remove that commit.

@Balastrong Balastrong force-pushed the feature/3063-added-support-for-ceil-floor-to-roundToNearestMinutes branch from 2647827 to 239f9dc Compare July 10, 2022 10:25
@tan75 tan75 mentioned this pull request Jul 10, 2022
4 tasks
Copy link
Contributor

@leshakoss leshakoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@leshakoss leshakoss merged commit b78bef0 into date-fns:master Jul 21, 2022
@Balastrong Balastrong deleted the feature/3063-added-support-for-ceil-floor-to-roundToNearestMinutes branch July 21, 2022 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for "ceil" or "floor" based rounding
3 participants