jtimeago

Tag lib for "Time ago" date formatting

License

License

GroupId

GroupId

com.aerse
ArtifactId

ArtifactId

jtimeago
Last Version

Last Version

1.3
Release Date

Release Date

Type

Type

jar
Description

Description

jtimeago
Tag lib for "Time ago" date formatting
Project URL

Project URL

https://github.com/dernasherbrezon/jtimeago
Source Code Management

Source Code Management

https://github.com/dernasherbrezon/jtimeago

Download jtimeago

How to add to project

<!-- https://jarcasting.com/artifacts/com.aerse/jtimeago/ -->
<dependency>
    <groupId>com.aerse</groupId>
    <artifactId>jtimeago</artifactId>
    <version>1.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.aerse/jtimeago/
implementation 'com.aerse:jtimeago:1.3'
// https://jarcasting.com/artifacts/com.aerse/jtimeago/
implementation ("com.aerse:jtimeago:1.3")
'com.aerse:jtimeago:jar:1.3'
<dependency org="com.aerse" name="jtimeago" rev="1.3">
  <artifact name="jtimeago" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.aerse', module='jtimeago', version='1.3')
)
libraryDependencies += "com.aerse" % "jtimeago" % "1.3"
[com.aerse/jtimeago "1.3"]

Dependencies

compile (2)

Group / Artifact Type Version
javax.servlet.jsp : javax.servlet.jsp-api jar 2.3.3
javax.servlet : javax.servlet-api jar 3.1.0

test (5)

Group / Artifact Type Version
junit : junit jar 4.10
org.eclipse.jetty : jetty-http jar 9.4.15.v20190215
org.eclipse.jetty : jetty-webapp jar 9.4.15.v20190215
org.eclipse.jetty : apache-jsp jar 9.4.15.v20190215
jstl : jstl jar 1.2

Project Modules

There are no modules declared in this project.

jtimeago Build Status Quality Gate Status

Tag lib for various date formatting:

  • "Time ago". Examples: 1 seconds ago, 2 months ago, just now
  • Interval. Examples: 2 months, 5 years, 1 year

Usage

Include dependency:

		<dependency>
			<groupId>com.aerse</groupId>
			<artifactId>jtimeago</artifactId>
			<version>1.3</version>
		</dependency>

Configure taglib:

<%@ taglib prefix="ta" uri="https://github.com/dernasherbrezon/jtimeago" %>

Time ago

Use as normal JSTL formatDate:

<ta:formatDate value="${comment.date}" pattern="dd MMM yyyy HH:mm" />

Supported configuration parameters:

  • value. Required. java.util.Date to format
  • pattern. Required. Pattern for SimpleDateFormat. Used for more than one day ago dates.
  • timeZone. Optional. String or java.util.TimeZone
  • var. Optional. Output into var with defined scope.
  • scope. Optional. scope for var

Interval

Format "years":

<ta:formatYear value="10" />

Supported configuration parameters:

  • value. Required. Number.
  • var. Optional. Output into var with defined scope.
  • scope. Optional. scope for var

Format "months":

<ta:formatMonth value="10" />

Supported configuration parameters:

  • value. Required. Number.
  • var. Optional. Output into var with defined scope.
  • scope. Optional. scope for var

Versions

Version
1.3
1.2
1.1