Package com.ocpsoft.pretty.time

Examples of com.ocpsoft.pretty.time.PrettyTime


  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    TemplateDateModel dateModel =  (TemplateDateModel) params.get("date");
    Date date = dateModel!=null ? dateModel.getAsDate() : null;
    Assert.notNull(date, "Parameter date can not be null!");
    PrettyTime prettyTime = new PrettyTime(env.getLocale());
    env.getOut().write(prettyTime.format(date));
  }
View Full Code Here


    for(Comment comment : comments) {
      Map<String, Object> model = CollectionUtil.newHashMap();
      model.put("id", comment.getId());
      model.put("linkedId", comment.getLinkedId());
      model.put("content", comment.getContent());
      model.put("entered_pretty", new PrettyTime().format(comment.getEntered()));
      model.put("enteredBy_project_profile_logo_id", comment.getEnteredBy().getProject().getProfile().getLogoId());
      model.put("enteredBy_project_category_code", comment.getEnteredBy().getProject().getCategory().getCode());
      model.put("enteredBy_project_uniqueId", comment.getEnteredBy().getProject().getUniqueId());
      commentList.add(model);
    }
View Full Code Here

    }

    public void onBookingComplete(@Observes(during = TransactionPhase.AFTER_SUCCESS) @Confirmed final Booking booking) {
        log.bookingConfirmed(booking.getHotel().getName(), booking.getUser().getName());
        messages.info(new DefaultBundleKey("booking_confirmed")).defaults("You're booked to stay at the {0} {1}.")
                .params(booking.getHotel().getName(), new PrettyTime(locale).format(booking.getCheckinDate()));
    }
View Full Code Here

    /** Creates a new instance of ServerInfoSupportBean */
    public ServerInfoSupportBean() {
    }
   
    public String getServerStartTime(){
        PrettyTime ptime = new PrettyTime();
        return ptime.format(utilBean.getServerStartTime());
       
    }
View Full Code Here

TOP

Related Classes of com.ocpsoft.pretty.time.PrettyTime

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.