Package com.google.gwt.i18n.client

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


      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


    boolean isValid = true;
    if ( null == editor.getStartDate() ) {
      isValid = false;
    } else {
      final DateTimeFormat format = DateTimeFormat.getFormat( "MM-dd-yyyy" ); //$NON-NLS-1$
      final String date = format.format( editor.getStartDate() );
      final String dateTime = date + " " + editor.getStartTime(); //$NON-NLS-1$

      if ( DateTimeFormat.getFormat( "MM-dd-yyyy hh:mm:ss a" ).parse( dateTime ).before( new Date() ) ) { //$NON-NLS-1$
        isValid = false;
      }
View Full Code Here

    tablePanel.add( table );
  }

  private String formatDate( final Date date ) {
    DateTimeFormat simpleDateFormat = DateTimeFormat.getFormat( "EEE, MMM dd h:mm a" );
    return simpleDateFormat.format( date );
  }

  private void removeBlockout( final JsJob jsJob ) {
    JSONObject jobRequest = new JSONObject();
    jobRequest.put( "jobId", new JSONString( jsJob.getJobId() ) ); //$NON-NLS-1$
View Full Code Here

    GWT.log(DateTimeFormat.getMediumDateTimeFormat().format(today));

    // A custom date format
    DateTimeFormat fmt = DateTimeFormat.getFormat("EEEE, MMMM dd, yyyy");
    // prints Monday, December 17, 2007 in the default locale
    GWT.log(fmt.format(today));
  }
}
View Full Code Here

    picker.addShowRangeHandler(new ShowRangeHandler<Date>() {
      public void onShowRange(ShowRangeEvent<Date> event) {
        Date start = event.getStart();
        Date end = event.getEnd();
        DateTimeFormat format = DateTimeFormat.getShortDateFormat();
        range.setText("range: " + format.format(start) + " - "
            + format.format(end));
      }
    });
    return p;
  };
View Full Code Here

      public void onShowRange(ShowRangeEvent<Date> event) {
        Date start = event.getStart();
        Date end = event.getEnd();
        DateTimeFormat format = DateTimeFormat.getShortDateFormat();
        range.setText("range: " + format.format(start) + " - "
            + format.format(end));
      }
    });
    return p;
  };
View Full Code Here

    h2.add(new Button("Show Values", new ClickHandler() {
      public void onClick(ClickEvent event) {
        DateTimeFormat f = DateTimeFormat.getShortDateFormat();
        Date d1 = start.getValue();
        Date d2 = end.getValue();
        value.setText("Start: \"" + (d1 == null ? "null" : f.format(d1))
            + "\" End: \"" + (d2 == null ? "null" : f.format(d2)) + "\"");
      }
    }));

    EventReporter<Date, DateBox> reporter = new EventReporter<Date, DateBox>();
View Full Code Here

      public void onClick(ClickEvent event) {
        DateTimeFormat f = DateTimeFormat.getShortDateFormat();
        Date d1 = start.getValue();
        Date d2 = end.getValue();
        value.setText("Start: \"" + (d1 == null ? "null" : f.format(d1))
            + "\" End: \"" + (d2 == null ? "null" : f.format(d2)) + "\"");
      }
    }));

    EventReporter<Date, DateBox> reporter = new EventReporter<Date, DateBox>();
    start.addValueChangeHandler(reporter);
View Full Code Here

              .toString().trim() );
          }
        }
      }
      DateTimeFormat timeFormat = DateTimeFormat.getFormat( PredefinedFormat.TIME_MEDIUM );
      trigDesc += " at " + timeFormat.format( getStartTime() );
    } else if ( "simpleJobTrigger".equals( getType() ) ) {
      // if (getRepeatInterval() > 0) {
      trigDesc = getSimpleDescription();

      // if (getStartTime() != null) {
View Full Code Here

    DateTimeFormat timeFormat = DateTimeFormat.getFormat( PredefinedFormat.TIME_MEDIUM );
    if ( scheduleType == ScheduleType.WEEKLY ) {
      int repeatInterval = getRepeatInterval();
      trigDesc =
          Messages.getString( "every" ) + " " + ( repeatInterval / 86400 ) + " " + Messages.getString( "daysLower" );
      trigDesc += " at " + timeFormat.format( getStartTime() );
    } else if ( intervalSeconds != getRepeatInterval() ) {
      trigDesc = Messages.getString( "every" ) + " " + intervalUnits;
      trigDesc += " at " + timeFormat.format( getStartTime() );
    } else {
      trigDesc = Messages.getString( "every" ) + " " + intervalUnits;
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.