Package org.ocpsoft.prettytime

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


    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


  @Test
  public void testWeeksFromNowSingle() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    assertEquals("viikon päästä", t.format(new Date(1000 * 60 * 60 * 24 * 7 * 1)));
  }

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

  @Test
  public void testWeeksAgoSingle() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 7 * 1), locale);
    assertEquals("viikko sitten", t.format(new Date(0)));
  }

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

  @Test
  public void testMonthsFromNow() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    assertEquals("3 kuukauden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 30 * 3)));
  }

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

  @Test
  public void testMonthsAgo() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 30 * 3), locale);
    assertEquals("3 kuukautta sitten", t.format(new Date(0)));
  }

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

  @Test
  public void testMonthFromNow() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    assertEquals("kuukauden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 30 * 1)));
  }

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

  @Test
  public void testMonthAgo() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 30 * 1), locale);
    assertEquals("kuukausi sitten", t.format(new Date(0)));
  }

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

  @Test
  public void testYearsFromNow() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    assertEquals("3 vuoden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 365 * 3)));
  }

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

  @Test
  public void testYearsAgo() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 365 * 3), locale);
    assertEquals("3 vuotta sitten", t.format(new Date(0)));
  }

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

  @Test
  public void testYearFromNow() throws Exception
  {
    PrettyTime t = new PrettyTime(new Date(0), locale);
    assertEquals("vuoden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 366 * 1)));
  }

  @Test
  public void testYearAgo() throws Exception
  {
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.