Permalink
Browse files

Support am/pm in in lower and upper case on input string

  • Loading branch information...
1 parent 3c02a05 commit 4c0aaa8126f095c86247b684ab15a88af027c8f7 @chasetec committed Apr 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 jquery.mobile.datebox.js
View
@@ -137,10 +137,10 @@
if(match === null) { //use current time if no match
return date;
}
- if(match[1] <= 12 && match[3] && match[3].charAt(0) == 'p') { //ignore pm if hour >12
+ if(match[1] <= 12 && match[3] && match[3].toLowerCase().charAt(0) == 'p') { //ignore pm if hour >12
match[1] = parseInt(match[1],10) + 12;
}
- if(match[1] == 12 && match[3] && match[3].charAt(0) == 'a') { //12am is the 0 hour
+ if(match[1] == 12 && match[3] && match[3].toLowerCase().charAt(0) == 'a') { //12am is the 0 hour
match[1] = 0;
}
} else {

0 comments on commit 4c0aaa8

Please sign in to comment.