lucy24 - 11:31 pm on Jul 2, 2012 (gmt 0)
Bingo. Didn't I say it would be something obvious that I know perfectly well? Default base 10 unless it's got a leading 0. I knew that. But the only other times I can remember using parseInt were either explicitly set to hexadecimal or they involved numbers that didn't use a leading zero.
To verify, I added a line that prints out the hour1 and hour2 values in addition to the intended output. Sure enough, times in "08" and "09" come through as 0. Ironically this means that the target range of 4-7 (that is, 5-6 allowing for gaps) is also being parsed as octal; it just happens to come out right because it's only one digit and it's less than 8. The "day" part isn't affected because that's just comparing strings. "08" != "09".
Aren't constructors fun? If your text editor is in RegEx mode, you have to start out with four \\\\ in order to end up with one \