Thymeleaf Joda Dialect

Adds Joda utility methods to Thymeleaf templates

Лицензия

Лицензия

Категории

Категории

Сеть Leaf Данные Базы данных
Группа

Группа

nz.net.ultraq.thymeleaf
Идентификатор

Идентификатор

thymeleaf-joda-dialect
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Thymeleaf Joda Dialect
Adds Joda utility methods to Thymeleaf templates
Ссылка на сайт

Ссылка на сайт

http://www.ultraq.net.nz/programming/thymeleaf-joda-dialect/
Система контроля версий

Система контроля версий

https://github.com/ultraq/thymeleaf-joda-dialect

Скачать thymeleaf-joda-dialect

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/nz.net.ultraq.thymeleaf/thymeleaf-joda-dialect/ -->
<dependency>
    <groupId>nz.net.ultraq.thymeleaf</groupId>
    <artifactId>thymeleaf-joda-dialect</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/nz.net.ultraq.thymeleaf/thymeleaf-joda-dialect/
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-joda-dialect:2.0.0'
// https://jarcasting.com/artifacts/nz.net.ultraq.thymeleaf/thymeleaf-joda-dialect/
implementation ("nz.net.ultraq.thymeleaf:thymeleaf-joda-dialect:2.0.0")
'nz.net.ultraq.thymeleaf:thymeleaf-joda-dialect:jar:2.0.0'
<dependency org="nz.net.ultraq.thymeleaf" name="thymeleaf-joda-dialect" rev="2.0.0">
  <artifact name="thymeleaf-joda-dialect" type="jar" />
</dependency>
@Grapes(
@Grab(group='nz.net.ultraq.thymeleaf', module='thymeleaf-joda-dialect', version='2.0.0')
)
libraryDependencies += "nz.net.ultraq.thymeleaf" % "thymeleaf-joda-dialect" % "2.0.0"
[nz.net.ultraq.thymeleaf/thymeleaf-joda-dialect "2.0.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.codehaus.groovy : groovy jar 2.4.6
joda-time : joda-time jar 2.9.2
org.thymeleaf : thymeleaf jar 3.0.0.RELEASE

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Thymeleaf Joda Dialect

Build Status Coverage Status GitHub Release Maven Central License

A dialect for Thymeleaf that adds Joda utility methods to Thymeleaf templates.

Installation

Minimum of Java 7 and Thymeleaf 3.0 required. For Thymeleaf 2.1, check out the 1.x releases.

Standalone distribution

Copy the JAR from one of the release bundles, placing it in the classpath of your program, or build the project from the source code here on GitHub.

For Maven and Maven-compatible dependency managers

Add a dependency to your project with the following co-ordinates:

  • GroupId: nz.net.ultraq.thymeleaf
  • ArtifactId: thymeleaf-joda-dialect
  • Version: (as per the badges above)

Usage

Add the Joda dialect to your existing Thymeleaf template engine, eg:

Java example:

templateEngine.addDialect(new JodaDialect());

Spring XML configuration example:

<bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
  ...
  <property name="additionalDialects">
    <set>
      <bean class="nz.net.ultraq.thymeleaf.JodaDialect"/>
    </set>
  </property>
</bean>

This will introduce the joda expression object to your Thymeleaf templates, adding 2 new utility methods you can use in your pages: createNow, and format.

createNow

Creates a new Joda DateTime instance whose time is the instant at which the method was called.

<div th:with="now=${#joda.createNow()}">...</div>

format

Formats a Joda DateTime instance according to the given format string. Documentation on the format string can be found on Joda's API pages here, although it's mostly compatible with the JDK date patterns that all Java devs know already.

<div th:text="${#joda.format(myDate, 'EEEE, d MMMM yyyy')}">...</div>

Версии библиотеки

Версия
2.0.0
1.0.2
1.0.1
1.0.0