Last active
May 30, 2019 16:20
-
-
Save matteocollina/160cefac2b97de7c314cce87f8ec9872 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//It works only for iOS, with Android i can't set picker with intervals | |
onDateChange={(date)=>{ | |
if(this.state.dateMode == "time" && this.state.minuteInterval){ | |
let hours = Number(String(date).split(":")[0]) | |
let minutes = Number(String(date).split(":")[1]) | |
let diff = minutes % this.state.minuteInterval | |
if(diff != 0){ | |
date = (String(hours)+":"+String(minutes-diff)) | |
} | |
} | |
this.onChangeDate(date) | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment