Package com.google.gwt.i18n.client

Examples of com.google.gwt.i18n.client.DateTimeFormat


  /**
   * Get the range from the timeline and put it in the textboxes on screen
   */
  private void getRange() {
    Timeline.DateRange range = timeline.getVisibleChartRange();
    DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");

    // set the new startdate and enddate
    txtStartDate.setText(dtf.format(range.getStart()));
    txtEndDate.setText(dtf.format(range.getEnd()));
  }
View Full Code Here


  /**
   * Get the entered dates from the textboxes on screen, and apply them to the
   * timeline
   */
  private void setRange() {
    DateTimeFormat datetime = DateTimeFormat
        .getFormat("yyyy-MM-dd HH:mm:ss");
    DateTimeFormat date = DateTimeFormat.getFormat("yyyy-MM-dd");

    Date startDate;
    Date endDate;

    // Try to parse the startdate
    try {
      startDate = datetime.parse(txtStartDate.getText());
    } catch (IllegalArgumentException err) {
      try {
        startDate = date.parse(txtStartDate.getText());
      } catch (IllegalArgumentException err2) {
        Window
            .alert("I don't understand the startdate that you entered :(");
        return;
      }
    }

    // Try to parse the enddate
    try {
      endDate = datetime.parse(txtEndDate.getText());
    } catch (IllegalArgumentException err) {
      try {
        endDate = date.parse(txtEndDate.getText());
      } catch (IllegalArgumentException err2) {
        Window
            .alert("I cannot make sense of the enddate that you entered :(");
        return;
      }
View Full Code Here

        DataTable data = DataTable.create();
        data.addColumn(DataTable.ColumnType.DATETIME, "time");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function A");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function B");

        DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd");

        // create data
        Date d = dtf.parse("2010-08-23");
        int n = 10000; // number of datapoints
        for (int i = 0; i < n; i++) {
          data.addRow();
          data.setValue(i, 0, new Date(d.getTime()));
          data.setValue(i, 1, customFunction(i));
View Full Code Here

  /**
   * Get the range from the timeline and put it in the textboxes on screen
   */
  private void getRange() {
    Graph.DateRange range = graph.getVisibleChartRange();
    DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");

    // set the new startdate and enddate
    txtStartDate.setText(dtf.format(range.getStart()));
    txtEndDate.setText(dtf.format(range.getEnd()));
  }
View Full Code Here

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
    DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd");

    JSONArray dataA = new JSONArray();
    JSONArray dataB = new JSONArray();

    // create data
    Date d = dtf.parse("2012-08-23");
    int n = 200; // number of datapoints
    for (int i = 0; i < n; i++) {
      JSONObject pointA = new JSONObject();
      pointA.put("date", new JSONNumber(d.getTime()));
      pointA.put("value", new JSONNumber(customFunctionA(i)));
View Full Code Here

  /**
   * Get the entered dates from the textboxes on screen, and apply them to
   * the timeline
   */ 
  private void setRange() {
    DateTimeFormat datetime = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");
    DateTimeFormat date = DateTimeFormat.getFormat("yyyy-MM-dd");
   
    Date startDate;
    Date endDate;
   
    // Try to parse the startdate
    try {
      startDate = datetime.parse(txtStartDate.getText());
    } catch (IllegalArgumentException err) {
      try {
      startDate = date.parse(txtStartDate.getText());
      } catch (IllegalArgumentException err2) {
        Window.alert("I don't understand the startdate that you entered :(");
        return;
      }
    }

    // Try to parse the enddate
    try {
      endDate = datetime.parse(txtEndDate.getText());
    } catch (IllegalArgumentException err) {
      try {
        endDate = date.parse(txtEndDate.getText());
      } catch (IllegalArgumentException err2) {
        Window.alert("I cannot make sense of the enddate that you entered :(");
        return;
      }
    }
View Full Code Here

    Element timeElement = DOM.createTD();
    trElement.appendChild(timeElement);
    timeElement.setClassName("msg-nick");
    timeElement.setAttribute("valign","bottom");
    timeElement.setAttribute("align", "right");
    DateTimeFormat timeFormat = DateTimeFormat.getMediumTimeFormat();
    String datetime = timeFormat.format(new java.util.Date());
    timeElement.setInnerHTML("<small>"+datetime+"</small>");
   
    Element messageElement = DOM.createSpan();
    messageElement.setInnerHTML(ChatTextFormatter.format(message == null ? "" : message).getHTML());
   
View Full Code Here

    Element timeElement = DOM.createTD();
    trElement.appendChild(timeElement);
    timeElement.setClassName("msg-nick");
    timeElement.setAttribute("valign","bottom");
    timeElement.setAttribute("align", "right");
    DateTimeFormat timeFormat = DateTimeFormat.getMediumTimeFormat();
    String datetime = timeFormat.format(new java.util.Date());
    timeElement.setInnerHTML("<small>"+datetime+"</small>");
   
    Element messageElement = DOM.createSpan();
    messageElement.setInnerHTML(ChatTextFormatter.format(message == null ? "" : message).getHTML());
   
View Full Code Here

  }
  @Override
  public boolean validate(String value) {
    boolean validation = true;
    try {
          final DateTimeFormat format = DateTimeFormat.getFormat(value);
          final int len = value.length();
          for (int i = 0; i < len; i ++) {
              switch (value.charAt(i)) {
                  case 's':
                  case 'S': throw new IllegalArgumentException("Rotating by second or millisecond is not supported");
View Full Code Here

         * not the same as the browser locale
         */
        formatStr = formatMonthNames(date, formatStr);

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

        String result = format.format(date);

        return result;
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.i18n.client.DateTimeFormat

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.