Examples of TimeFormat


Examples of org.ocpsoft.prettytime.TimeFormat

   {
      bundle = ResourceBundle.getBundle(unit.getResourceBundleName(), locale);

      if (bundle instanceof TimeFormatProvider)
      {
         TimeFormat format = ((TimeFormatProvider) bundle).getFormatFor(unit);
         if (format != null)
         {
            this.override = format;
         }
      }
View Full Code Here

Examples of org.ocpsoft.prettytime.TimeFormat

    }

    @Override
    public TimeFormat getFormatFor(TimeUnit t) {
        if (t instanceof JustNow) {
            return new TimeFormat() {
                @Override
                public String format(Duration duration) {
                    return performFormat(duration);
                }
View Full Code Here

Examples of org.ocpsoft.prettytime.TimeFormat

    }

    @Override
    public TimeFormat getFormatFor(TimeUnit t) {
        if (t instanceof JustNow) {
            return new TimeFormat() {
                @Override
                public String format(Duration duration) {
                    return performFormat(duration);
                }
View Full Code Here

Examples of org.ocpsoft.prettytime.TimeFormat

   @Override
   public TimeFormat getFormatFor(TimeUnit t)
   {
      if (t instanceof Minute)
      {
         return new TimeFormat() {

            @Override
            public String decorate(Duration duration, String time)
            {
               String result = duration.getQuantityRounded(50) > 1 ? time + "i" : "o";
View Full Code Here

Examples of org.ocpsoft.prettytime.TimeFormat

   @Test
   public void testDecorating() throws Exception
   {
      PrettyTime t = new PrettyTime();
      TimeFormat format = new SimpleTimeFormat().setFutureSuffix("from now").setPastSuffix("ago");

      Duration duration = t.approximateDuration(new Date(System.currentTimeMillis() + 1000));
      assertEquals("some time from now", format.decorate(duration, "some time"));

      duration = t.approximateDuration(new Date(System.currentTimeMillis() - 10000));
      assertEquals("some time ago", format.decorate(duration, "some time"));
   }
View Full Code Here

Examples of railo.runtime.format.TimeFormat

                    break;
              }
              sb.append('\'');
                  sb.append(new DateFormat(Locale.US).format(d,"yyyy-mm-dd"));
                  sb.append(' ');
                  sb.append(new TimeFormat(Locale.US).format(d,"HH:mm:ss"));
                  sb.append('\'');
                  ps.next();
                  continue outer;
                }
                else {
View Full Code Here

Examples of viewer.zoomable.TimeFormat

        if ( nfmt == null ) {
            nfmt = (DecimalFormat) NumberFormat.getInstance();
            nfmt.applyPattern( FORMAT );
        }
        if ( tfmt == null )
            tfmt = new TimeFormat();
        if ( Normal_Border == null ) {
            /*
            Normal_Border = BorderFactory.createCompoundBorder(
                            BorderFactory.createRaisedBevelBorder(),
                            BorderFactory.createLoweredBevelBorder() );
View Full Code Here

Examples of viewer.zoomable.TimeFormat

        if ( fmt == null ) {
            fmt = (DecimalFormat) NumberFormat.getInstance();
            fmt.applyPattern( FORMAT );
        }
        if ( tfmt == null )
            tfmt = new TimeFormat();
        if ( Normal_Border == null ) {
            /*
            Normal_Border = BorderFactory.createCompoundBorder(
                            BorderFactory.createRaisedBevelBorder(),
                            BorderFactory.createLoweredBevelBorder() );
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.