You have a problem with the base. Javascript interprets 07, 08, 09 as octal numbers. Decimal 7 and Octal 07 are evaluated with the same number, while 8 and 9 are not.
Include the base 10 radius as the second parameter for all your parseInt() calls:
var m = 'Jan08'; var mm = 'Jan'; alert(m.replace(mm, '')); alert(parseInt(m.replace(mm, ''), 10));
source share