Date advance/subtract taglib ver. 1.3

    Custom JSP taglib lets you advance to or subtract from a given date. For example:
 


<%@ taglib uri="taglib.tld" prefix="d" %>

<!-- 2 days from now -->
<d:DateAdd>2</d:DateAdd>

<!-- 3 years ago -->
<d:DateAdd unit="y">-3</d:DateAdd>

Here tag treats own body as an integer value for days (years, hours, minutes, seconds) depends on the parameter unit and add to (or subtract from for the negative value) this value to (from) the given time.

Tags are:

DateAdd

Body tag lets you advance to or subtract from a given date.

1) id Optional parameter. Describes a name for page scope variable (type is java.util.Date) for a new date. Without this parameter tag just prints data.
2) now Optional parameter. Describes an original date. Accepted types are java.util.Date or java.util.Calendar. By default tag will use the current date.
3) unit Optional parameter. Describes a unit for the value. Possible values are y (add/sub years), m (month), d (days), hh (hours), mm (minutes). By default it is d (days).

for downloading:

Library: dateaddtag.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: