jdewit / bootstrap-timepicker

[Deprecated] A simple timepicker component for Twitter Bootstrap
MIT License
1.64k stars 1.09k forks source link

Fix BUG pad hours with leading zero #219

Open marcoscarraro opened 10 years ago

marcoscarraro commented 10 years ago

Please update on bootstrap-timepicker.min.js

New function to add 0 using 24 hours!!!

replace

return this.hour||this.minute||this.second?this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:""):""}

for

return(this.hour.toString().length===1?"0"+this.hour:this.hour)+":"+(this.minute.toString().length===1?"0"+this.minute:this.minute)+(this.showSeconds?":"+(this.second.toString().length===1?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")}

danielpina commented 10 years ago

thanks for that

eleumik commented 10 years ago

you're welcome, but I believe this is only in my fork, have you tried it ?

mrhota commented 9 years ago

link from title: https://github.com/MartijnR/bootstrap-timepicker/commit/aa3653b02c339c53e88ee3d0611e4e566a882c42#commitcomment-5887335