We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I cant seem to find a way to do this, so I assume that currently it is impossible?
If so, it would be great to have this as a function.
Using this library to calculate penalty times by the hour, so it would be nice to have a round up function!
The text was updated successfully, but these errors were encountered:
hey @owen95t i'd love to know more about your idea -
we currently have .nearest, which could be coerced like this:
let rounded = s.nearest('hour') if(rounded.isBefore(s)){ rounded=rounded.add(1, 'hour') }
lemme know cheers
Sorry, something went wrong.
@spencermountain
One of the options that I love about dayjs is that their diff can actually return a float.
So instead of the logic above, i can simply do a
let rounded = Math.ceil(x.diff(y, 'hour', true)) / / true option allows for returning a float in dayjs
let rounded = Math.ceil(x.diff(y, 'hour', true))
/ / true option allows for returning a float in dayjs
But I am using spacetime due to how spacetime can manipulate time, which i think is better than dayjs in the application I am working on.
Using nearest is a good option as well, just thought that it would also be nice to get a float back for more manipulation
No branches or pull requests
I cant seem to find a way to do this, so I assume that currently it is impossible?
If so, it would be great to have this as a function.
Using this library to calculate penalty times by the hour, so it would be nice to have a round up function!
The text was updated successfully, but these errors were encountered: