Package org.ocpsoft.prettytime

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


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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @Test
  public void testMillenniaAgo() 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.