public static int sortDate(Date input1 , Date input2){
    int result = 0;
    if (input1 == null && input2 == null){
      result =  0;
    } else if (input1 == null){
      result =  1;
    } else if (input2 == null){
      result =  -1;
    } else{
      if (input1.before(input2)) {
        result = -1;
      } else if (input1.after(input2)) {
        result = 1;
      }
    }
    return result;
  }