Package com.google.ical.values

Examples of com.google.ical.values.DateTimeValueImpl


    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


    }
    return result;
  }

  public static DateTimeValue dayStart(DateValue dv) {
    return new DateTimeValueImpl(dv.year(), dv.month(), dv.day(), 0, 0, 0);
  }
View Full Code Here

   * were provided.
   * @return not null
   */
  public DateTimeValue toDateTime() {
    normalize();
    return new DateTimeValueImpl(year, month, day, hour, minute, second);
  }
View Full Code Here

  DateValue monkeySeeDateValue(boolean timed) {
    double daysFromNow = (10 * rnd.nextGaussian()) + 10// bias towards future
    if (timed) {
      return TimeUtils.add(
          refDate, new DateTimeValueImpl(
              0, 0, 0, 0, 0, (int) (daysFromNow * 24 * 60 * 60)));
    } else {
      assert !(refDate instanceof TimeValue);
      return TimeUtils.add(refDate, new DateValueImpl(0, 0, (int) daysFromNow));
    }
View Full Code Here

  }

  public void testMonkey3() throws Exception {
    runRecurrenceIteratorTest(
        "RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1;BYSECOND=14",
        new DateTimeValueImpl(2006, 5, 9, 3 /* + 7 */, 45, 40), PST, 3, null,
        "20060509T104540,20070509T104514,20080509T104514,...");
  }
View Full Code Here

  public void testMonkey5() throws Exception {
    // for some reason, libical goes backwards in time on this one
    runRecurrenceIteratorTest(
        "RRULE:FREQ=WEEKLY;COUNT=14;INTERVAL=1;BYMONTH=11,6,7,7,12",
        new DateTimeValueImpl(2006, 5, 2, 22, 46, 53), PST, 15, null,
        "20060503T054653,"
        // dtstart doesn't match the BYMONTH, so it is not counted towards the
        // count.  There are 14 instances following.
        + "20060607T054653,20060614T054653,20060621T054653,20060628T054653,"
        + "20060705T054653,20060712T054653,20060719T054653,20060726T054653,"
View Full Code Here

  public void testMonkey6() throws Exception {
    // libical doesn't include dtstart for this one
    runRecurrenceIteratorTest(
        "RRULE:FREQ=MONTHLY;UNTIL=20060510T151044Z;INTERVAL=1;BYSECOND=48",
        new DateTimeValueImpl(2006, 4, 5, 4, 42, 26), PST, 5, null,
        // dtstart
        "20060405T114226,"
        // bysecond rule kicks in
        + "20060405T114248,20060505T114248");
  }
View Full Code Here

  public void testMonkey7() throws Exception {
    // a bug in the by week generator was causing us to skip Feb 2007
    runRecurrenceIteratorTest(
        "RRULE:FREQ=WEEKLY;WKST=SU;INTERVAL=1",
        new DateTimeValueImpl(2006, 5, 8, 9, 47, 41), PST, 48, null,
        "20060508T164741,20060515T164741,20060522T164741,20060529T164741,"
        + "20060605T164741,20060612T164741,20060619T164741,20060626T164741,"
        + "20060703T164741,20060710T164741,20060717T164741,20060724T164741,"
        + "20060731T164741,20060807T164741,20060814T164741,20060821T164741,"
        + "20060828T164741,20060904T164741,20060911T164741,20060918T164741,"
View Full Code Here

  }

  public void testMonkey12() throws Exception {
    runRecurrenceIteratorTest( // 4, 5, 13, 29, 31
        "RRULE:FREQ=DAILY;INTERVAL=1;BYMONTHDAY=5,29,31,-19,-28",
        new DateTimeValueImpl(2006, 5, 2, 18, 47, 45), PST, 6, null,
        "20060503T014745,20060505T014745,20060506T014745,"
        + "20060514T014745,20060530T014745,20060601T014745,..."
        );
  }
View Full Code Here

    // last=2006-09-21 07:00:51, current=2006-09-21 07:00:51

    runRecurrenceIteratorTest(
        "RRULE:FREQ=DAILY;WKST=SU;INTERVAL=1;BYMINUTE=59",
        new DateTimeValueImpl(2006, 9, 20, 23, 15, 51), PST, 4, null,
        "20060921T061551,20060921T065951,20060922T065951,20060923T065951,..."
        );
    // we can't actually create an RRULE with BYMINUTE=60 since that's out of
    // range
    // TODO(msamuel): write me
View Full Code Here

TOP

Related Classes of com.google.ical.values.DateTimeValueImpl

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.