Examples of DateWrapper


Examples of com.sencha.gxt.core.client.util.DateWrapper

  @Override
  public void setValue(Date date, boolean fireEvents) {
    if (date == null) {
      this.value = null;
      update(new DateWrapper().resetTime());
    } else {
      this.value = new DateWrapper(date).resetTime();
      update(value);
    }

    if (overElement != null) {
      appearance.onUpdateDateStyle(overElement, DateState.OVER, false);
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

        appearance.onMonthSelected(mpYears.getElement(i), false);
      }
      appearance.onMonthSelected(pn, true);
      mpSelYear = pn.getPropertyInt("xyear");
    } else if (target.is(appearance.monthPickerOkSelector())) {
      DateWrapper d = new DateWrapper(mpSelYear, mpSelMonth, 1);
      update(d);
      hideMonthPicker();
    } else if (target.is(appearance.monthPickerCancelSelector())) {
      hideMonthPicker();
    } else if (target.is(appearance.leftYearSelector())) {
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

    }
  }

  protected void onKeyEnd(NativeEvent evt) {
    if (evt.getShiftKey()) {
      setValue(new DateWrapper(activeDate.getFullYear(), 11, 31).asDate());
    } else {
      setValue(activeDate.getLastDateOfMonth().asDate(), false);
    }
  }
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

    setValue(activeDate.asDate());
  }

  protected void onKeyHome(NativeEvent evt) {
    if (evt.<XEvent> cast().getCtrlOrMetaKey()) {
      setValue(new DateWrapper(activeDate.getFullYear(), 0, 1).asDate());
    } else {
      setValue(activeDate.getFirstDayOfMonth().asDate(), false);
    }
  }
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

  private void handleDateClick(XElement target, String dt) {
    String[] tokens = dt.split(",");
    int year = Integer.parseInt(tokens[0]);
    int month = Integer.parseInt(tokens[1]);
    int day = Integer.parseInt(tokens[2]);
    Date d = new DateWrapper(year, month, day).asDate();
    if (d != null && !appearance.isDisabled(target.getParentElement())) {
      setValue(d);
    }
  }
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

    });
    monthPicker.<FxElement> cast().slideOut(Direction.UP, fx);
  }

  private void selectToday() {
    setValue(new DateWrapper().asDate());
  }
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

  }

  private void setCellStyle(Element cell, Date d, long sel, long min, long max) {
    long t = d.getTime();

    DateWrapper w = new DateWrapper(d);
    int year = w.getFullYear();
    int month = w.getMonth();
    int day = w.getDate();

    String dd = year + "," + month + "," + day;

    cell.getFirstChildElement().setPropertyString("dateValue", dd);
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

  private void showPrevMonth() {
    setValue(activeDate.addMonths(-1).asDate(), false);
  }

  private void update(DateWrapper date) {
    DateWrapper vd = activeDate;
    activeDate = date;
    if (vd != null) {
      int days = date.getDaysInMonth();
      DateWrapper firstOfMonth = date.getFirstDayOfMonth();
      int startingPos = firstOfMonth.getDayInWeek() - firstDOW;

      if (startingPos <= firstDOW) {
        startingPos += 7;
      }

      // go to previous month.
      DateWrapper pm = activeDate.addMonths(-1);
      int prevStart = pm.getDaysInMonth() - startingPos;

      days += startingPos;

      DateWrapper d = new DateWrapper(pm.getFullYear(), pm.getMonth(), prevStart).resetTime();
      today = new DateWrapper().resetTime().getTime();
      long sel = value != null ? value.resetTime().getTime() : Long.MIN_VALUE;
      long min = minDate != null ? new DateWrapper(minDate).getTime() : Long.MIN_VALUE;
      long max = maxDate != null ? new DateWrapper(maxDate).getTime() : Long.MAX_VALUE;

      int i = 0;
      for (; i < startingPos; i++) {
        appearance.onTextChange(cells[i], "" + ++prevStart);
        d = d.addDays(1);
        appearance.onUpdateDateStyle(cells[i], DateState.PREVIOUS, true);
        setCellStyle(cells[i], d.asDate(), sel, min, max);
      }
      for (; i < days; i++) {
        int intDay = i - startingPos + 1;
        appearance.onTextChange(cells[i], "" + intDay);
        d = d.addDays(1);
        appearance.onUpdateDateStyle(cells[i], DateState.ACTIVE, true);
        setCellStyle(cells[i], d.asDate(), sel, min, max);
      }
      int extraDays = 0;
      for (; i < 42; i++) {
        appearance.onTextChange(cells[i], "" + ++extraDays);
        d = d.addDays(1);
        appearance.onUpdateDateStyle(cells[i], DateState.NEXT, true);
        setCellStyle(cells[i], d.asDate(), sel, min, max);
      }
      int month = activeDate.getMonth();

      String t = constants.monthsFullStandalone()[month] + " " + activeDate.getFullYear();
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

  }

  private void fillStore() {
    if (!initialized) {
      this.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);

      store.clear();

      while (min.before(max)) {
        store.add(min.asDate());
View Full Code Here

Examples of com.sencha.gxt.core.client.util.DateWrapper

    }
  }

  @SuppressWarnings("deprecation")
  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
TOP
Copyright © 2018 www.massapi.com. 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.