Create a calendar with a complex expression

About this task

Use this method to create a calendar when:

  • The calendar needs to be valid on certain days, but must exclude other days, such as holidays
  • The calendar needs to be valid on dates that are already defined in one calendar, and also on dates already defined in another calendar

Procedure

  1. Open the Calendar Editor.
  2. From the Calendar menu, select New Calendar and select Combine Calendars. The combine calendars dialog box appears.

    The dialog box is shown here with the list of calendars expanded on the left.

  3. In the Description field, specify a description for the calendar that makes it obvious when this calendar is valid. This description is very useful: it is displayed in the fly-over text when you point to a calendar name in the list, and helps you quickly determine which calendar you want to use.
  4. Create an expression that combines the calendars as required: double-click on calendar names and operators to create the desired expression. See “Operators and their meanings” for a description of the operators.
    Tip:

    To see the operators, you may need to drag the operator window over from the very right-hand side of the main window.

    For example, if you want to create a calendar that is true on Mondays and Tuesdays, double-click on the calendar Mondays. Then double-click on Plus, then double-click on the calendar Tuesdays. The new calendar will be valid every day that Mondays is valid plus every day that Tuesdays is valid.

  5. Optional. Verify that the expression yields the correct results: from the View menu, select View Occurrences. A calendar is displayed with all of the resulting dates highlighted.
  6. Save the calendar: from the Calendar menu, select Save Calendar. When prompted, specify a meaningful name for the calendar. Click Save. The calendar is added to the list of centrally stored calendars, under your user name. For information on naming calendars, see “About calendar names” section.

Operators and their meanings

When creating a calendar expression, you can choose from the following operators:


Operator

Description

In common with

Use this operator to resolve to the intersection of two sets of dates—only those dates in common between two calendars

Plus

Use this operator to combine two sets of dates—any of the dates specified in the two calendars

Not

Use this operator to exclude the dates in a calendar—use only those dates that are not included in the calendar.

(

Use this operator to begin an expression nested within the expression

)

Use this operator to end an expression nested within the expression.

Not in common with

Use this operator to exclude dates. First specify the expression that resolves to the dates you do want to include, then use this operator followed by those dates you do not want to include.