Examples of calculatePreciseDuration()


Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

    @Test
    public void testFormattingDurationListInThePast() throws Exception
    {
        PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), locale);
        List<Duration> durations = t.calculatePreciseDuration(new Date(0));
        assertEquals("3 päeva 15 tundi 38 minutit tagasi", t.format(durations));
    }

    @Test
    public void testFormattingDurationListInTheFuture() throws Exception
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

    @Test
    public void testFormattingDurationListInTheFuture() throws Exception
    {
        PrettyTime t = new PrettyTime(new Date(0), locale);
        List<Duration> durations = t.calculatePreciseDuration(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15
                + 1000 * 60 * 38));
        assertEquals("3 päeva 15 tunni 38 minuti pärast", t.format(durations));
    }


View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

  @Test
  public void testFormattingDurationListInThePast() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), locale);
    List<Duration> durations = t.calculatePreciseDuration(new Date(0));
    assertEquals("3 päivää 15 tuntia 38 minuuttia sitten", t.format(durations));
  }

  @Test
  public void testFormattingDurationListInTheFuture() throws Exception
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

  @Test
  public void testFormattingDurationListInTheFuture() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    List<Duration> durations = t.calculatePreciseDuration(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15
        + 1000 * 60 * 38));
    assertEquals("3 päivän 15 tunnin 38 minuutin päästä", t.format(durations));
  }


View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

   @Test
   public void testPreciseInTheFuture() throws Exception
   {
      PrettyTime t = new PrettyTime();
      List<Duration> durations = t.calculatePreciseDuration(new Date(new Date().getTime() + 1000
               * (10 * 60 + 5 * 60 * 60)));
      assertTrue(durations.size() >= 2); // might be more because of milliseconds between date capturing and result
      // calculation
      assertEquals(5, durations.get(0).getQuantity());
      assertEquals(10, durations.get(1).getQuantity());
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

   @Test
   public void testPreciseInThePast() throws Exception
   {
      PrettyTime t = new PrettyTime();
      List<Duration> durations = t.calculatePreciseDuration(new Date(new Date().getTime() - 1000
               * (10 * 60 + 5 * 60 * 60)));
      assertTrue(durations.size() >= 2); // might be more because of milliseconds between date capturing and result
      // calculation
      assertEquals(-5, durations.get(0).getQuantity());
      assertEquals(-10, durations.get(1).getQuantity());
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

   @Test
   public void testFormattingDurationListInThePast() throws Exception
   {
      PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38));
      List<Duration> durations = t.calculatePreciseDuration(new Date(0));
      assertEquals("3일 15시간 38분 전", t.format(durations));
   }

   @Test
   public void testFormattingDurationListInTheFuture() throws Exception
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

   @Test
   public void testFormattingDurationListInTheFuture() throws Exception
   {
      PrettyTime t = new PrettyTime(new Date(0));
      List<Duration> durations = t.calculatePreciseDuration(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15
               + 1000 * 60 * 38));
      assertEquals("3일 15시간 38분 후", t.format(durations));
   }

   @Test
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

  @Test
  public void testFormattingDurationListInThePast() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), locale);
    List<Duration> durations = t.calculatePreciseDuration(new Date(0));
    assertEquals("3 giorni 15 ore 38 minuti fa", t.format(durations));
  }

  @Test
  public void testFormattingDurationListInTheFuture() throws Exception
View Full Code Here

Examples of org.ocpsoft.prettytime.PrettyTime.calculatePreciseDuration()

  @Test
  public void testFormattingDurationListInTheFuture() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    List<Duration> durations = t.calculatePreciseDuration(new Date(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15
        + 1000 * 60 * 38));
    assertEquals("fra 3 giorni 15 ore 38 minuti", t.format(durations));
  }


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.