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;
}

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 ; }
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 .
