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));
}
}