Package org.ocpsoft.prettytime

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


    @Test
    public void testDecadeAgo() throws Exception
    {
        PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 365 * 11), locale);
        assertEquals("aastakümme tagasi", 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 sajandi pärast", 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 sajandit tagasi", 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("sajandi pärast", 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("sajand tagasi", 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 aastatuhande pärast", t.format(new Date(1000L * 60 * 60 * 24 * 365 * 1000 * 3)));
    }

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

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

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

    @Test
    public void testMillenniumFromNow() throws Exception
    {
        PrettyTime t = new PrettyTime(new Date(0), locale);
        assertEquals("aastatuhande pärast", t.format(new Date(1000L * 60 * 60 * 24 * 365 * 1001)));
    }

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

    @Test
    public void testMillenniumAgo() throws Exception
    {
        PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 365 * 1001), locale);
        assertEquals("aastatuhat tagasi", t.format(new Date(0)));
    }

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

    @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

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.