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

minutes=60 minutes (none increments of 5) issue. #19

Closed
eldenskloss opened this issue Aug 14, 2017 · 1 comment
Closed

minutes=60 minutes (none increments of 5) issue. #19

eldenskloss opened this issue Aug 14, 2017 · 1 comment

Comments

@eldenskloss
Copy link

Assigning minutes (for example 60 [0-59]), when setting the time using initDate={now.toISOString()}, will set time to the wrong position. If time is 8:40, it will set the minutes to the 8th position (Because 40/5 = 8, default minutes are in increments of 5).
8:50 will set minutes to the 10th position and so on.

Not sure if this is a bug or if I am setting up minutes incorrectly.

Doing something like this:

//in my constructor I am setting minutesArray up using a loop, 0-59. Tried both nums and strings
this.minutesArray = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'];
for(let i = 10 ; i < 60; i++){
this.minutesArray.push(String(i))
}

render() {

let now = new Date();
return (
  	<TimePicker
       minutes={this.minutesArray}
     onTimeSelected={(date)=>this.onTimeSelected(date))}
       initDate={now.toISOString()}/>
);

}

If there is a way to set time to be 0-59 without increments of 5, that will also fix my problem.

Thanks

@eldenskloss eldenskloss changed the title 60 minutes minutes=60 minutes (none increments of 5) issue. Aug 14, 2017
@ArtemKosiakevych
Copy link
Collaborator

@eldenskloss
Thank you for issue, fixed in 1.0.2 version

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

2 participants