Wrong format of minutes when 24hours format is used
Hi, when I'm trying to user 24hours format and insert 0-9 minutes, it is not formatted correctly. E.g for 23:02, the result is 23:2. I guess the problem is in timepicki.js on line https://github.com/senthilraj/TimePicki/blob/master/js/timepicki.js#L37 as it ruins previously prepared value for values lower than 10.
Same problem. Have you solved it?
I'm using downloaded library in my project, so I just removed line https://github.com/senthilraj/TimePicki/blob/master/js/timepicki.js#L37 I quickly analyzed the code and I think it is OK without this line...just give it a try...
Martin is absolutely correct, removing line 37 was the fix I was coming here to suggest. From a quick assessment of the code, it seems this line should not be there at all, it simply overrides the string modification on the previous few lines causing the picker to display the wrong format for minutes.
For the record, the line to be remove should read:
mini = Math.min(Math.max(parseInt(mini), 0), 59);
Martin solved the puzzle!