Examples of truncate()


Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.MONTH);
    assertEquals(1492, 4, 1, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.DAY);
    assertEquals(1492, 4, 21, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.HOUR);
    assertEquals(1492, 4, 21, 23, 0, 0, d);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.DAY);
    assertEquals(1492, 4, 21, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.HOUR);
    assertEquals(1492, 4, 21, 23, 0, 0, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.MIN);
    assertEquals(1492, 4, 21, 23, 56, 0, d);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.HOUR);
    assertEquals(1492, 4, 21, 23, 0, 0, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.MIN);
    assertEquals(1492, 4, 21, 23, 56, 0, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.SEC);
    assertEquals(1492, 4, 21, 23, 56, 31, d);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.MIN);
    assertEquals(1492, 4, 21, 23, 56, 0, d);

    d = createTestDate(1492, 4, 21, 23, 56, 31, 555);
    d.truncate(TimeUnit.SEC);
    assertEquals(1492, 4, 21, 23, 56, 31, d);
  }
 
  /**
   * Week truncation requires special logic.  Test this functionality separately.
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

   * Week truncation requires special logic.  Test this functionality separately.
   */
  public void testTruncateWeek() {
    // Monday, Oct 13
    ChronoDate d = createTestDate(2008, 9, 13, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
    assertEquals(2008, 9, 12, d);

    // Saturday, Oct 18
    d = createTestDate(2008, 9, 18, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d.truncate(TimeUnit.WEEK);
    assertEquals(2008, 9, 12, d);

    // Saturday, Oct 18
    d = createTestDate(2008, 9, 18, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
    assertEquals(2008, 9, 12, d);

    // Friday, Oct 3
    d = createTestDate(2008, 9, 3, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d.truncate(TimeUnit.WEEK);
    assertEquals(2008, 9, 12, d);

    // Friday, Oct 3
    d = createTestDate(2008, 9, 3, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
    assertEquals(2008, 8, 28, d); // expect Sun, Sept 28 '08

    // Wed, Jan 2, 2008
    d = createTestDate(2008, 0, 2, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d.truncate(TimeUnit.WEEK);
    assertEquals(2008, 8, 28, d); // expect Sun, Sept 28 '08

    // Wed, Jan 2, 2008
    d = createTestDate(2008, 0, 2, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
    assertEquals(2007, 11, 30, d); // expect Sun, Dec 30, '07

    // Sun, Jan 2, 1200
    d = createTestDate(1200, 0, 2, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d.truncate(TimeUnit.WEEK);
    assertEquals(2007, 11, 30, d); // expect Sun, Dec 30, '07

    // Sun, Jan 2, 1200
    d = createTestDate(1200, 0, 2, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
    assertEquals(1200, 0, 2, d); // expect Sun, Jan 2, 1200

    // Sat, Jan 1, 1200
    d = createTestDate(1200, 0, 1, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.date.ChronoDate.truncate()

    d.truncate(TimeUnit.WEEK);
    assertEquals(1200, 0, 2, d); // expect Sun, Jan 2, 1200

    // Sat, Jan 1, 1200
    d = createTestDate(1200, 0, 1, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
    assertEquals(1199, 11, 26, d); // expect Sun, Dec 26, 1199

    // Tue, Mar 20, 1582
    d = createTestDate(1582, 2, 20, 23, 59, 59, 123);
    d.truncate(TimeUnit.WEEK);
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.