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

Cannot set hour 24:00 #367

Open
hplodur opened this issue Apr 3, 2017 · 5 comments
Open

Cannot set hour 24:00 #367

hplodur opened this issue Apr 3, 2017 · 5 comments

Comments

@hplodur
Copy link

hplodur commented Apr 3, 2017

Is there any way to have a possibility to set hour 24:00. I can set 23:59 but is there a possibility to set hour 24 when showMeridian is set to false?

@hplodur
Copy link
Author

hplodur commented Apr 3, 2017

I figure out the possibility to have hour 24:00 with setting maxHours to 25 or 24.1. Sorry for that. But I've noticed that I can still setup minutes so I can set 24:59 and it will accept. Is there a possibility to configure it in a way that when the hour 24 is chosen it sets minutes to 00?

@anothermouse
Copy link

anothermouse commented Apr 26, 2017

24:00 does not exist as a time. The correct time for midnight is: 00:00. The day starts at zero not 1.
However, if you want to have a date-timepicker that copes with specialist leap seconds then you might wish to look at:

https://www.timeanddate.com/time/leapseconds.html
...although I believe that these are managed by adding 23:59:60 as an extra second

Might be an issue for people working in the rather specialise atomic time measurement industry?
Realistically, this shouldn't be an issue for anyone using this timepicker widget.

@hplodur
Copy link
Author

hplodur commented Jun 15, 2017

Is there any way to add to either decrementHour or decrementMinute function then when maxHours-1 has been chosen the minutes and seconds will be "00"?

@hplodur
Copy link
Author

hplodur commented Jun 15, 2017

Within timepicker.js I've modified few lines and added a variable maxHoursMSalign and this did the trick. It's decrement to maxHours -1 when maxHoursMSalign set to true. I'm posting it here if someone will be looking for similar solution.

35    this.maxHoursMSalign = options.maxHoursMSalign;

870    if (this.maxHoursMSalign == true) {
871      if (hour >= this.maxHours) {
872        // No day/date handling.
873        hour = this.maxHours - 1;
874        minute = 0;
875        second = 0;
876      }
877      if (hour == this.maxHours -1) {
878        minute = 0;
879        second = 0;
880      }
881    } else {
882      if (hour >= this.maxHours) {
883        // No day/date handling.
884        hour = this.maxHours - 1;
885      }
886    }

@jerko-culina
Copy link

jerko-culina commented Nov 21, 2018

24:00 does not exist as a time.

rails/rails#7125 (comment)

From issue above:

Between 00:00 and 24:00 is 24 hour different. If you will have date representation then yes, 00:00 and 24:00 is same, because date is different. But when you have only time representation, 00:00 and 24:00 are different. 00:00 is begin of the day, 24:00 is 24 hours from day begin.
Another example: 00:00 to 24:00 represents nonstop. 00:00 to 00:00 is represents as same time, so closed or off.

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

3 participants