Calendar JSP taglib custom day lists
 Basics     Display     Titles     Fonts     Scrolling     Selection     Day Lists     Advanced Topics     
 
>
A Named Day is typically a holiday, day of recognition, or any date of significance your circumstances dictate. A variety of holidays and special days are displayed by default. The name of each is displayed as the mouse pointer passes over the date. Days are grouped into lists, each with unique attributes. Usage and display of named days is through <cal:namedDayGroup>, <cal:namedDay> and <cal:dayDisplay> tags.

Default Day Lists
Default lists are provided for US Federal holidays, US Federal Social days, US Social days, and US Religious days or Ecclesiastical days. These day lists are displayed by default. Each list may be disabled individually or all default day lists may be disabled using the <cal:namedDayGroup> tag.
  • <cal:namedDayGroup name="defaults" enabled="false"/>

Custom Day Lists
Custom lists are enclosed by the <cal:namedDayGroup> tag. The list contains one or more day definitions, each defined by the <cal:namedDay> tag.

Day List Display
By default the layout for the weekday of the date is displayed. The layout is defined using one or more <cal:dayDisplay> tags. Explicitly a dayGroup or namedDayGroup may be referenced using the dayGroups attribute of the <cal:namedDayGroup> tag, or the layout defined using <cal:dayDisplay> tags.

Day List Content
A named day is composed of a name and a fixed date or a calculated date. Calculated dates may have a fixed month or be an offset from a special date. An example of a fixed date, calculated date, and offset from a special date is Christmas, Thanksgiving, and Mardi Gras. The syntax for each is:
  • <cal:namedDay name='Christmas' date='12/25'/>
  • <cal:namedDay name='Thanksgiving' month='November' week='4' weekday='Thursday'/>
  • <cal:namedDay name='Mardi Gras' fromSpecial='Easter' daysFrom='-47'/>

Dates with a fixed month, also identify a week and weekday attribute. The weekday attribute is any valid weekday name or the validated key word of 'only'. The key word of 'only' alters dates that fall on Saturday to fall on the preceeding date and dates that fall on Sunday to fall on the following date. The week attribute is a valid index in the month or a validated key word. Supported key words for the week attribute are: 'last' and 'lastfullweek'. The key word 'last' calculates the last occurrance of the identified weekday. The key word 'lastfullweek' calculates the last occurrance of the identified weekday in a week that has a Sunday and Saturday in the identified month.

Special date calculations identify a specialDate attribute by key word or date. Supported key words are 'Easter' and 'USPresidentialElection'. The date may be any valid date, the year is optional. Examples include: '11/2' and '12/31/1999'. The offset may be calculated in days (positive or negative) using the daysFrom, month, week, or year attributes. The offset may be combined with the absolute weekday or date attribute to define the calculated date.

Day List Example
Figure 1:
<cal:calendar initialDate='5/31/2004'>
<cal:namedDayGroup name="defaults" enabled="false"/>
<cal:namedDayGroup name="myList" color='#30d030' dayGroups="week">
     <cal:namedDay name='fixed date' date='5/15' weekday='only'/>
     <cal:namedDay name='calculated date' month='5' week='1' weekday='Friday'/>
     <cal:namedDay name='calculated offset date' fromSpecial='5/31' week='-2'/>
</cal:namedDayGroup>
</cal:calendar>

 
Figure 1:
May, 2004
Su Mo Tu We Th Fr Sa
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5