question: private static String forceNumberStringToTwoDigits ( String text ) { while ( text . length ( ) < 2 ) { text = "0" + text ; } if ( text . length ( ) > 2 ) { text = text . substring ( text . length ( ) - 2 , text . length ( ) ) ; } return text ; }
target:  forceNumberStringToTwoDigits, This takes a string of digits, and forces it to be two digits long. First any extra leftmost digits are truncated, leaving only the right one digit or right two digits. If there is only one digit, it is zero padded to enforce a two digit string result. This function is used by the DatePickerUtilities.doesParsedDateMatchText() function.