Package org.ocpsoft.prettytime.units

Examples of org.ocpsoft.prettytime.units.Minute


   private void initTimeUnits()
   {
      addUnit(new JustNow());
      addUnit(new Millisecond());
      addUnit(new Second());
      addUnit(new Minute());
      addUnit(new Hour());
      addUnit(new Day());
      addUnit(new Week());
      addUnit(new Month());
      addUnit(new Year());
View Full Code Here


   @Test
   public void testCalculatePreciseDuration()
   {
       PrettyTime prettyTime = new PrettyTime();
       prettyTime.clearUnits();
       Minute minutes = new Minute();
       prettyTime.registerUnit(minutes, new ResourcesTimeFormat(minutes));
       assertEquals("40 minutes ago",
               prettyTime.format(prettyTime.calculatePreciseDuration(new Date(new Date().getTime() - 40*60*1000 - 40*1000))));
   }
View Full Code Here

TOP

Related Classes of org.ocpsoft.prettytime.units.Minute

Copyright © 2018 www.massapicom. 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.