Package com.google.visualization.datasource.datatable.value

Examples of com.google.visualization.datasource.datatable.value.DateValue


   */
  private DateValue parseDate(String val) throws ParseException {
    Date date = ((SimpleDateFormat) uFormat).parse(val);
    GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
    gc.setTime(date);
    return new DateValue(gc);
  }
View Full Code Here


    // If the given value is null, return a null date value.
    if (value.isNull()) {
      return DateValue.getNullValue();
    }
    DateValue dateValue;
    switch(value.getType()) {
      case DATE:
        dateValue = (DateValue) value;
        break;
      case DATETIME:
        dateValue = new DateValue((GregorianCalendar)
            (((DateTimeValue) value).getObjectToFormat()));
        break;
      case NUMBER:
        date = new Date((long) ((NumberValue) value).getValue());
        gc.setTime(date);
        dateValue = new DateValue(gc);
        break;
      default:// Should never get here.
        throw new RuntimeException("Value type was not found: " + value.getType());
    }
    return dateValue;
View Full Code Here

  private static DateValue parseDate(String val, DateFormat format)
      throws ParseException {
    Date date = format.parse(val);
    GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
    gc.setTime(date);
    return new DateValue(gc);
  }
View Full Code Here

TOP

Related Classes of com.google.visualization.datasource.datatable.value.DateValue

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.