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

minute_step, round to the nearest time without remainder #16

Open
andreypolyak opened this issue Mar 11, 2021 · 1 comment
Open

minute_step, round to the nearest time without remainder #16

andreypolyak opened this issue Mar 11, 2021 · 1 comment
Labels
feature request New feature or request

Comments

@andreypolyak
Copy link

First of all thank you for the great card!

Problem

Suggested feature / solution

Currently if I have for example 15:24 as a time and minute_step=15 in the config, if I press "ᐱ" button it will change time to 15:39, then to 15:54, 16:09, etc. Instead as an option I'd like to have it first changed to 15:30, then to to 15:45, 16:00, etc. So to have after each interaction minutes without remainder.

Additional context

@andreypolyak andreypolyak added the feature request New feature or request label Mar 11, 2021
@GeorgeSG
Copy link
Owner

GeorgeSG commented Mar 27, 2021

I don't have a lot of time to work on the card for now, but I like the idea.

In case anyone wants to give it a try and open a PR, here's how I would go about it briefly:

  • Add an option round: true (maybe round_step or round_to_step?). Defaults to false.
  • Pass option to TimeUnit
  • Implement in TimeUnit's setValue

Be mindful of Minute.willOverflow and Second.willOverflow.

Repository owner deleted a comment from github-actions bot Dec 6, 2022
@GeorgeSG GeorgeSG removed the stale label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants