Examples of DateTimeValue


Examples of com.google.ical.values.DateTimeValue

    int minutesInDay = secsInDay / 60;
    int minute = minutesInDay % 60;
    int hour = minutesInDay / 60;
    if (!(hour >= 0 && hour < 24)) throw new AssertionError(
        "Input was: " + secsSinceEpoch + "to make hour: " + hour);
    DateTimeValue result =
      new DateTimeValueImpl(year, month, day, hour, minute, second);
    // assert result.equals(normalize(result));
    // assert secsSinceEpoch(result) == secsSinceEpoch;
    return result;
  }
View Full Code Here

Examples of com.google.ical.values.DateTimeValue

                 DateTimeIteratorFactory.dateTimeToDateValue(
                     dateTime(2006, 10, 13, 12, 30, 1)));
  }

  public void testConsistency() throws Exception {
    DateTimeValue dtv = new DateTimeValueImpl(2006, 10, 13, 12, 30, 1);
    assertEquals(dtv, DateTimeIteratorFactory.dateTimeToDateValue(
                     DateTimeIteratorFactory.dateValueToDateTime(dtv)));
  }
View Full Code Here

Examples of com.google.ical.values.DateTimeValue

    }
  }

  public void testDurationConstructor() throws Exception {
    final DateValue DV = new DateValueImpl(2005, 2, 15);
    final DateTimeValue DTV0 = new DateTimeValueImpl(2005, 2, 15, 0, 0, 0),
      DTV12 = new DateTimeValueImpl(2005, 2, 15, 12, 0, 0);
    DateValue ONE_DAY = new DateValueImpl(0, 0, 1),
      YESTERDAY = new DateValueImpl(0, 0, -1),
      ONE_WEEK = new DateValueImpl(0, 0, 7),
      ONE_MONTH = new DateValueImpl(0, 1, 0),
      ONE_YEAR = new DateValueImpl(1, 0, 0);
    DateTimeValue ONE_HOUR = new DateTimeValueImpl(0, 0, 0, 1, 0, 0),
      TWELVE_HOURS = new DateTimeValueImpl(0, 0, 0, 12, 0, 0),
      SAME_TIME = new DateTimeValueImpl(0, 0, 0, 0, 0, 0);

    assertEquals(PeriodValueImpl.create(DV, new DateValueImpl(2005, 2, 16)),
                 PeriodValueImpl.createFromDuration(DV, ONE_DAY));
View Full Code Here

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

    assertEquals(NumberValue.getNullValue(),
        dataTable.getRow(2).getCell(4).getValue());
    assertEquals("true", dataTable.getRow(2).getCell(5).getValue().toString());
    assertEquals(dataTable.getRow(0).getCell(6).getValue().toString(),
        new DateValue(gc), dataTable.getRow(0).getCell(6).getValue());
    assertEquals(new DateTimeValue(gc),
        dataTable.getRow(0).getCell(7).getValue());
    assertEquals(new TimeOfDayValue(gc),
        dataTable.getRow(0).getCell(8).getValue());
    assertEquals(DateValue.getNullValue(),
        dataTable.getRow(1).getCell(6).getValue());
View Full Code Here

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

    row.addCell(new TableCell("aaa"));
    row.addCell(new TableCell(222));
    row.addCell(new TableCell(false));
    row.addCell(new TableCell(new DateValue(2001, 10, 14)));
    row.addCell(new TableCell(new TimeOfDayValue(12, 11, 13, 14)));
    row.addCell(new TableCell(new DateTimeValue(2000, 10, 1, 1, 10, 23, 432)));
    rows.add(row);

    row = new TableRow();
    row.addCell(new TableCell("ccc"));
    row.addCell(new TableCell(111));
    row.addCell(new TableCell(true));
    row.addCell(new TableCell(new DateValue(2001, 1, 14)));
    row.addCell(new TableCell(new TimeOfDayValue(12, 30, 13, 14)));
    row.addCell(new TableCell(new DateTimeValue(1000, 11, 1, 1, 10, 23, 432)));
    rows.add(row);

    row = new TableRow();
    row.addCell(new TableCell("bbb"));
    row.addCell(new TableCell(3));
    row.addCell(new TableCell(true));
    row.addCell(new TableCell(new DateValue(2012, 2, 14)));
    row.addCell(new TableCell(new TimeOfDayValue(12, 11, 3, 14)));
    row.addCell(new TableCell(new DateTimeValue(2000, 1, 1, 1, 10, 31, 4)));
    rows.add(row);

    row = new TableRow();
    row.addCell("ddd");
    row.addCell(222);
    row.addCell(false);
    row.addCell(new DateValue(1997, 5, 5));
    row.addCell(new TimeOfDayValue(12, 15, 15, 14));
    row.addCell(new DateTimeValue(3100, 1, 2, 15, 15, 1, 0));
    rows.add(row);

    testData.addRows(rows);
  }
View Full Code Here

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

  }

  public void testAppendCellJson() {
    TableCell dateCell = new TableCell(new DateValue(2009, 1, 12));
    TableCell timeofdayCell = new TableCell(new TimeOfDayValue(12, 13, 14, 15));
    TableCell datetimeCell = new TableCell(new DateTimeValue(2009, 1, 12, 12, 13, 14, 15));
    TableCell booleanCell = new TableCell(true);
    TableCell numberCell = new TableCell(12.3);
    TableCell textCell = new TableCell("aba");

View Full Code Here

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

    rows = Lists.newArrayList();

    TableRow row = new TableRow();
    row.addCell(new TableCell(new DateValue(2011, 1, 1), "1/1/2011"));
    row.addCell(new TableCell(new DateTimeValue(2011, 1, 1, 0, 0, 0, 0), "1/1/2011 00:00:00"));
    row.addCell(new TableCell(new NumberValue(222), "222"));
    rows.add(row);

    row = new TableRow();
    row.addCell(new TableCell(new DateValue(2011, 1, 2), "1/2/2011"));
    row.addCell(new TableCell(new DateTimeValue(2011, 1, 2, 3, 15, 0, 0)));
    row.addCell(new TableCell(NumberValue.getNullValue()));
    rows.add(row);

    row = new TableRow();
    row.addCell(new TableCell(new DateValue(2011, 1, 3), "1/3/2011"));
    row.addCell(new TableCell(new DateTimeValue(2011, 1, 3, 3, 15, 0, 0), "1/1/2011 03:15:00"));
    row.addCell(new TableCell(333));
    rows.add(row);

    row = new TableRow();
    row.addCell(new TableCell(new DateValue(2011, 1, 4)));
    row.addCell(new TableCell(new DateTimeValue(2011, 1, 4, 0, 0, 0, 0)));
    row.addCell(new TableCell(222));
    rows.add(row);
   
    testData.addRows(rows);
    assertEquals(
View Full Code Here

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

                 timestamp.getDate(), timestamp.getHours(), timestamp.getMinutes(),
                 timestamp.getSeconds());
          // Set the milliseconds explicitly, as they are not saved in the
          // underlying date.
          gc.set(Calendar.MILLISECOND, timestamp.getNanos() / 1000000);
          value = new DateTimeValue(gc);
        }
        break;
      case TIMEOFDAY:
        Time time = rs.getTime(column);
        // If time is null it is handled later.
View Full Code Here

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

    TableRow row = new TableRow();
    row.addCell(new TableCell(new DateValue(2008, 5, 3)));
    row.addCell(new TableCell(new NumberValue(23)));
    row.addCell(new TableCell(new TimeOfDayValue(13, 12, 11)));
    row.addCell(new TableCell(new DateTimeValue(2007, 3, 4, 2, 6, 23, 120)));

    // Check date value.
    List<AbstractColumn> columns =
        Lists.newArrayList((AbstractColumn) new SimpleColumn("dateCol"));
     ScalarFunctionColumn sfc =
View Full Code Here

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

    Query query = QueryBuilder.getInstance().parseQuery("WHERE c1 > DATE '2006-08-23'");
    assertEquals(new DateValue(2006, 7, 23),
        ((ColumnValueFilter) query.getFilter()).getValue());
    query = QueryBuilder.getInstance().parseQuery(
        "WHERE c1 = DaTeTiMe '2007-01-30 15:33:22.432'");
    assertEquals(new DateTimeValue(2007, 0, 30, 15, 33, 22, 432),
        ((ColumnValueFilter) query.getFilter()).getValue());
    query = QueryBuilder.getInstance().parseQuery(
        "WHERE c1 = timesTaMP '2007-01-30 15:33:22.432'");
    assertEquals(new DateTimeValue(2007, 0, 30, 15, 33, 22, 432),
        ((ColumnValueFilter) query.getFilter()).getValue());
    query = QueryBuilder.getInstance().parseQuery("WHERE c1 != TimeOfDay '15:33:22'");
    assertEquals(new TimeOfDayValue(15, 33, 22),
        ((ColumnValueFilter) query.getFilter()).getValue());
  }
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.