Skip to content

Commit fb2846c

Browse files
committed
1 parent e5771fe commit fb2846c

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_ua.java renamed to core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_uk.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* reedit to Ukrainian with Eclipse). User: Ihor Lavrynuk Date: 2013-01-06 Time: 15:04
3030
*
3131
*/
32-
public class Resources_ua extends ListResourceBundle implements TimeFormatProvider
32+
public class Resources_uk extends ListResourceBundle implements TimeFormatProvider
3333
{
3434
private static final Object[][] OBJECTS = new Object[0][0];
3535

‎core/src/main/java/org/ocpsoft/prettytime/units/JustNow.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class JustNow extends ResourcesTimeUnit implements TimeUnit
2323

2424
public JustNow()
2525
{
26-
setMaxQuantity(1000L * 60L * 5L);
26+
setMaxQuantity(1000L * 60L);
2727
}
2828

2929
@Override

‎core/src/test/java/org/ocpsoft/prettytime/PrettyTimeAPIManipulationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public void testGetUnit()
167167
public void testChangeUnit()
168168
{
169169
JustNow unit = t.getUnit(JustNow.class);
170-
assertEquals(1000L * 60L * 5L, unit.getMaxQuantity());
170+
assertEquals(1000L * 60L, unit.getMaxQuantity());
171171
unit.setMaxQuantity(1);
172172
assertEquals(1, t.getUnit(JustNow.class).getMaxQuantity());
173173
}

core/src/test/java/org/ocpsoft/prettytime/PrettyTimeI18n_UA_Test.java renamed to core/src/test/java/org/ocpsoft/prettytime/PrettyTimeI18n_uk_Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
/**
2929
* User: Ihor Lavrynuk Date: 2013-01-05 Time: 16:57
3030
*/
31-
public class PrettyTimeI18n_UA_Test
31+
public class PrettyTimeI18n_uk_Test
3232
{
3333
private final SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
3434
private Locale locale;
3535

3636
@Before
3737
public void setUp() throws Exception
3838
{
39-
locale = new Locale("ua");
39+
locale = new Locale("uk");
4040
Locale.setDefault(locale);
4141
}
4242

‎core/src/test/java/org/ocpsoft/prettytime/PrettyTimeTest.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ public void testRightNow() throws Exception
6767
Assert.assertEquals("moments from now", t.format(new Date()));
6868
}
6969

70+
@Test
71+
public void testCalculatePreciceDuration() throws Exception
72+
{
73+
PrettyTime t = new PrettyTime();
74+
List<Duration> preciseDuration = t.calculatePreciseDuration(
75+
new Date(System.currentTimeMillis() - (2 * 60 * 60 * 1000) - (2 * 60 * 1000)));
76+
Assert.assertEquals("2 hours 2 minutes ago", t.format(preciseDuration));
77+
Assert.assertEquals("2 hours 2 minutes", t.formatDuration(preciseDuration));
78+
}
79+
7080
@Test
7181
public void testRightNowVariance() throws Exception
7282
{

0 commit comments

Comments
 (0)