date() check bug fixed.
refactored common checks between integer() and integerWithSpaces() methods