Package com.google.gwt.i18n.client

Examples of com.google.gwt.i18n.client.DateTimeFormat.format()


        DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy");
        while (first.before(currentEndDate)) {
            Label lbl = new Label();
            lbl.setWidth(width + "px");
            lbl.setText(formatter.format(first));
            lbl.setStyleName(CLASSNAME_SCALEDATE);

            timeFromStart = first.getTime() - currentStartDate.getTime();
            float x = timeFromStart * xUnit + paddingLeft;

View Full Code Here


            tooltip.getCellFormatter().setStyleName(2, 0, "bottomLeft");
            tooltip.getCellFormatter().setStyleName(2, 1, "bottomMiddle");
            tooltip.getCellFormatter().setStyleName(2, 2, "bottomRight");

            HTML content = new HTML(
                    "<span class=date>"+formatter.format(new Date(time))+"</span> <br/>"+
                    "<span class=text>"+description+"</span>"
            );

            tooltip.setWidget(1, 1, content);
View Full Code Here

        formatStr = formatMonthNames(date, formatStr);

        // Format uses the browser locale
        DateTimeFormat format = DateTimeFormat.getFormat(formatStr);

        String result = format.format(date);

        return result;
    }

    private String formatMonthNames(Date date, String formatStr) {
View Full Code Here

    date = new DateWrapper(date).resetTime().asDate();

    if (minValue != null && date.before(minValue)) {
      String error = null;
      if (getMessages().getMinText() != null) {
        error = Format.substitute(getMessages().getMinText(), format.format(minValue));
      } else {
        error = GXT.MESSAGES.dateField_minText(format.format(minValue));
      }
      markInvalid(error);
      return false;
View Full Code Here

    if (minValue != null && date.before(minValue)) {
      String error = null;
      if (getMessages().getMinText() != null) {
        error = Format.substitute(getMessages().getMinText(), format.format(minValue));
      } else {
        error = GXT.MESSAGES.dateField_minText(format.format(minValue));
      }
      markInvalid(error);
      return false;
    }
    if (maxValue != null && date.after(maxValue)) {
View Full Code Here

      return false;
    }
    if (maxValue != null && date.after(maxValue)) {
      String error = null;
      if (getMessages().getMaxText() != null) {
        error = Format.substitute(getMessages().getMaxText(), format.format(maxValue));
      } else {
        error = GXT.MESSAGES.dateField_maxText(format.format(maxValue));
      }
      markInvalid(error);
      return false;
View Full Code Here

    if (maxValue != null && date.after(maxValue)) {
      String error = null;
      if (getMessages().getMaxText() != null) {
        error = Format.substitute(getMessages().getMaxText(), format.format(maxValue));
      } else {
        error = GXT.MESSAGES.dateField_maxText(format.format(maxValue));
      }
      markInvalid(error);
      return false;
    }
View Full Code Here

    if (val != null && val instanceof Number && c.getNumberFormat() != null) {
      Number n = (Number) val;
      val = c.getNumberFormat().format(n.doubleValue());
    } else if (val != null && val instanceof Date && c.getDateTimeFormat() != null) {
      DateTimeFormat dtf = c.getDateTimeFormat();
      val = dtf.format((Date) val);
    }

    String text = null;
    if (val != null) {
      text = val.toString();
View Full Code Here

      Number n = (Number) val;
      NumberFormat nf = cm.getColumn(colIndex).getNumberFormat();
      val = nf.format(n.doubleValue());
    } else if (val != null && c.getDateTimeFormat() != null) {
      DateTimeFormat dtf = c.getDateTimeFormat();
      val = dtf.format((Date) val);
    }

    String text = null;
    if (val != null) {
      text = val.toString();
View Full Code Here

    public String getDateString() {
        String t = textWidget.getText();
        Date date = this.visualFormatFormatter.parse( t );
        DateTimeFormat formatter = DateTimeFormat.getFormat( defaultFormat );
        return formatter.format( date );
    }

    /**
     * Set the date from the dropdowns
     * @return
 
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.