Please enable JavaScript to view this site.

 

Navigation: Tokens > Tip and Tricks

Moving Minicalendars According to the Weekday a Month Starts

Scroll Prev Up Next More

Often, in a monthly grid, you may need to display mini-calendars in a different position, depending of the weekday that each particular month starts on.

 

In the example below, two mini-calendars are placed at the top left, unless the month starts on a Monday or a Tuesday. When that happens, the 2 mini-calendars are moved to the bottom right of the spread.

 

   

 

This is accomplished by the use of zap tokens in the mini-calendar tokens, as shown below left (for the top left mini-calendars) and below right (for the bottom right) mini-calendars.

 

   

 

The zap token on the left verifies if the value of the [2d] token is smaller than 3. If so, then it deletes the textbox containing the mini-calendar and, because it uses an uppercase Z, it also deletes any objects grouped to the mini-calendar textbox (such as lines).

 

In less technical terms, the textbox is deleted, if the date of the first Tuesday is either the 1st of the month or the 2nd. The zap token at the bottom right verifies the exact opposite, and therefore only one group of mini-calendars is ever displayed for a given month.

 

See also: other tokens tips and tricks.

 


Topic 108308, last updated on 18-Apr-2020