Sun Java System Calendar Server 6 2005Q4 Administration Guide

Conditional Printing

Sometimes it is desirable to print a line only under certain conditions. For example, the following lines:

title: %S%N
 start: %B%N
 end: %E%N  

produce output that resembles the following notification:

title: Staff Meeting
 start: Feb 04, 1999 09:00:00
 end: Feb 04, 1999 10:00:00 

There are two conditions, however, where the above example would yield misleading or incorrect results:

In these situations, it is best not to print the end time at all. By default, only the year, month, and day are printed when a time stamp has the attribute of being all-day. Furthermore, if an event start time has the all-day attribute and the event ends on the same day as it starts, a special conditional flag is set. Use the ? modifier to print conditional values only when the special conditional flag is not set.

For example, if you change the lines in the above example to:

title: %S%N
 start: %B%N
 end: %?E%N 

The last line will not be printed for all-day events for which the start day and end day are the same. It produces the following output for typical all-day events (such as birthdays or anniversaries):

title: Staff Meeting
 start: Feb 04, 1999

The ? flag can be combined with other modifiers. For example:

The event ends: %?(%b %d, %Y %I:%M %p)E%N