Package com.extjs.gxt.ui.client.util

Examples of com.extjs.gxt.ui.client.util.DateWrapper


  @Override
  protected void initList() {
    initialized = true;

    DateWrapper min = minValue != null ? new DateWrapper(resetDate(minValue)) : new DateWrapper(1970, 0, 1).clearTime();
    DateWrapper max = maxValue != null ? new DateWrapper(resetDate(maxValue))
        : new DateWrapper(1970, 0, 1).clearTime().addDays(1);

    List<Time> times = new ArrayList<Time>();
    while (min.before(max)) {
      times.add(new Time(min.asDate(), getFormat().format(min.asDate())));
      min = min.addMinutes(increment);
View Full Code Here


      getInputEl().dom.setAttribute("title", getMessages().getAriaText());
    }
  }

  private Date resetDate(Date date) {
    return new DateWrapper(1970, 0, 1).clearTime().addHours(date.getHours()).addMinutes(date.getMinutes()).addSeconds(date.getSeconds()).asDate();
  }
View Full Code Here

  @Override
  public boolean validateModel(ModelData model) {
    Date d = getModelValue(model);

    long time = d == null ? 0l : new DateWrapper(d).clearTime().getTime();
    if (beforeItem.isChecked() && beforeMenu.getDate() != null) {
      long pvalue = new DateWrapper(beforeMenu.getDate()).clearTime().getTime();
      if (d == null || pvalue <= time) {
        return false;
      }
    }
    if (afterItem.isChecked() && afterMenu.getDate() != null) {
      long pvalue = new DateWrapper(afterMenu.getDate()).clearTime().getTime();
      if (d == null || pvalue >= time) {
        return false;
      }
    }
    if (onItem.isChecked() && onMenu.getDate() != null) {
      long pvalue = new DateWrapper(onMenu.getDate()).resetTime().getTime();
      if (d == null || pvalue != (d == null ? 0l : new DateWrapper(d).resetTime().getTime())) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

    if ("after".equals(comparison)) {
      return v.before(t);
    } else if ("before".equals(comparison)) {
      return v.after(t);
    } else if ("on".equals(comparison)) {
      t = new DateWrapper(t).resetTime().asDate();
      v = new DateWrapper(v).resetTime().asDate();
      return !v.equals(t);
    }
    return true;
  }
View Full Code Here

   *
   * @param maxDate the max date
   */
  public void setMaxDate(Date maxDate) {
    if (maxDate != null) {
      maxDate = new DateWrapper(maxDate).resetTime().asDate();
    }
    this.maxDate = maxDate;
    if (rendered) {
      update(value);
    }
View Full Code Here

   *
   * @param minDate the minimum date
   */
  public void setMinDate(Date minDate) {
    if (minDate != null) {
      minDate = new DateWrapper(minDate).resetTime().asDate();
    }
    this.minDate = minDate;
    if (rendered) {
      update(value);
    }
View Full Code Here

   *
   * @param date the date
   * @param supressEvent true to suppress the select event
   */
  public void setValue(Date date, boolean supressEvent) {
    this.value = new DateWrapper(date).resetTime();
    if (rendered) {
      update(value);
    }
    if (!supressEvent) {
      DatePickerEvent de = new DatePickerEvent(this);
View Full Code Here

      mpYears.removeStyleName("x-date-mp-sel");
      El elem = target.findParent("td.x-date-mp-year", 2);
      elem.addStyleName("x-date-mp-sel");
      mpSelYear = pn.dom.getPropertyInt("xyear");
    } else if (target.is("button.x-date-mp-ok")) {
      DateWrapper d = new DateWrapper(mpSelYear, mpSelMonth, 1);
      update(d);
      hideMonthPicker();
    } else if (target.is("button.x-date-mp-cancel")) {
      hideMonthPicker();
    } else if (target.is("a.x-date-mp-prev")) {
View Full Code Here

    }
  }

  protected void onKeyEnd(ComponentEvent ce) {
    if (ce.isShiftKey()) {
      setValue(new DateWrapper(activeDate.getFullYear(), 11, 31).asDate());
    } else {
      setValue(activeDate.getLastDateOfMonth().asDate());
    }
  }
View Full Code Here

    setValue(activeDate.asDate());
  }

  protected void onKeyHome(ComponentEvent ce) {
    if (ce.isShiftKey()) {
      setValue(new DateWrapper(activeDate.getFullYear(), 0, 1).asDate());
    } else {
      setValue(activeDate.getFirstDayOfMonth().asDate());
    }
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.util.DateWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.