Class PrintDateOnceIfSame

java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.directives.PrintDateOnceIfSame
All Implemented Interfaces:
Nice2TemplateDirective, TemplateIdentifiers, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

public class PrintDateOnceIfSame extends Object implements Nice2TemplateDirective, TemplateIdentifiers
Directive to format two dates in freemarker If the two dates are on the same day the date gets only printed once, else both dates will be displayed. parameters: startDate (required): the startDate of the entity endDate (required): the endDate of the entity withTime (optional): should the time be displayed. Default is false withWeekday (optional): should the weekday be displayed. Default is false example: [@printDateOnceIfSame startDate=startDate endDate=endDate withTime=false withWeekday=true/]
  • Constructor Details

  • Method Details

    • execute

      public void execute(freemarker.core.Environment env, Map params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body) throws freemarker.template.TemplateException, IOException
      Specified by:
      execute in interface freemarker.template.TemplateDirectiveModel
      Throws:
      freemarker.template.TemplateException
      IOException