コード例 #1
0
 public PresentationObject getHandlerObject(String name, String value, IWContext iwc) {
   this.setName(name);
   if (value != null) {
     SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
     try {
       Date date = formatter.parse(value);
       java.sql.Date sqlDate = new java.sql.Date(date.getTime());
       setDate(sqlDate);
       return this;
     } catch (ParseException ex) {
       logError("[DateInput] The value " + value + " could not be parsed");
       // go further to the default setting
     }
   }
   IWTimestamp to = IWTimestamp.RightNow();
   this.setYearRange(SYSTEM_LAUNCH_YEAR, to.getYear());
   this.setDate(to.getDate());
   return this;
 }
コード例 #2
0
  private void addMenuElementsToDropdowns() {
    IWTimestamp stamp = IWTimestamp.RightNow();
    int currentYear = stamp.getYear();

    if (this.showYear) {
      this.setYearRange(currentYear, currentYear + 5);
    }

    if (this.showNullValue) {
      this.theMonth.addMenuElement("00");
    }
    this.theMonth.addMenuElement("01");
    this.theMonth.addMenuElement("02");
    this.theMonth.addMenuElement("03");
    this.theMonth.addMenuElement("04");
    this.theMonth.addMenuElement("05");
    this.theMonth.addMenuElement("06");
    this.theMonth.addMenuElement("07");
    this.theMonth.addMenuElement("08");
    this.theMonth.addMenuElement("09");
    this.theMonth.addMenuElement("10");
    this.theMonth.addMenuElement("11");
    this.theMonth.addMenuElement("12");

    if (this.showNullValue) {
      this.theDay.addMenuElement("00", "D");
    }
    this.theDay.addMenuElement("01", "1");
    this.theDay.addMenuElement("02", "2");
    this.theDay.addMenuElement("03", "3");
    this.theDay.addMenuElement("04", "4");
    this.theDay.addMenuElement("05", "5");
    this.theDay.addMenuElement("06", "6");
    this.theDay.addMenuElement("07", "7");
    this.theDay.addMenuElement("08", "8");
    this.theDay.addMenuElement("09", "9");
    this.theDay.addMenuElement("10", "10");
    this.theDay.addMenuElement("11", "11");
    this.theDay.addMenuElement("12", "12");
    this.theDay.addMenuElement("13", "13");
    this.theDay.addMenuElement("14", "14");
    this.theDay.addMenuElement("15", "15");
    this.theDay.addMenuElement("16", "16");
    this.theDay.addMenuElement("17", "17");
    this.theDay.addMenuElement("18", "18");
    this.theDay.addMenuElement("19", "19");
    this.theDay.addMenuElement("20", "20");
    this.theDay.addMenuElement("21", "21");
    this.theDay.addMenuElement("22", "22");
    this.theDay.addMenuElement("23", "23");
    this.theDay.addMenuElement("24", "24");
    this.theDay.addMenuElement("25", "25");
    this.theDay.addMenuElement("26", "26");
    this.theDay.addMenuElement("27", "27");
    this.theDay.addMenuElement("28", "28");
    this.theDay.addMenuElement("29", "29");
    this.theDay.addMenuElement("30", "30");
    this.theDay.addMenuElement("31", "31");

    if (this.showYear && this.showNullValue) {
      this.theYear.addMenuElement("YY");
    }
  }