TagLib: Calendar

dateroll

Description

The dateroll tag rolls the specified datetime bean. If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.

Tag Body

JSP

Restrictions

None.

Attributes

The tag has the following attributes:

Attribute

Description

Req'd?

name Specifies the datetime bean to operate on. If not specified then search for a datetime parent tag. No
field

Specifies the java.util.Calendar field of the roll; defaults to DATE.

No
amount

Specifies the amount of the roll; an integer value, defaults to "1". Positive values roll forward; negative values roll backward.

No

Properties

None.

Example(s)


<%-- roll forward one day from today --%>
<cal:datetime id="now"/>
<cal:dateroll name="now"/>

<%-- roll forward 2 weeks --%>
<cal:datetime id="now"/>
<cal:dateroll name="now"
amount="2" field="WEEK_OF_YEAR"/>

<%-- roll back 5 hours --%>
<cal:datetime id="now"/>
<cal:dateroll name="now"
amount="-5" field="HOUR"/>