Using other Tokens in MiniCalendars

Navigation:  Tokens > MiniCalendar Tokens >

Using other Tokens in MiniCalendars

Previous pageReturn to chapter overviewNext page

When constructing minicalendars, you are not limited to displaying only the minicalendar-specific markers for weekdays, week numbers and dates. You can add any token within a textbox that contains a minicalendar, even a macro token.


The only apsect of tokens placed inside minicalendars which can be a cause of error is whether you place a token before or after the Minicalendar Marker Token. Remembering that, when scanning, Q++ reads tokens from left to right and top to bottom, the rules are :


Any token placed before the Minicalendar Marker Token is evaluated exactly as if it were in a separate textbox anywhere else in the GridTemplate.


Any token placed after the Minicalendar Marker Token is evaluated as if the DayValue 1 corresponded to the 1st day of the month of the minicalendar (click here for more details).


Let us look at a concrete example. In the example below, we put 2 series of tokens, each series the same [d]/[m]/[yyyy], but one series (in red) before the [3mc-01] marker, and the other (in black) after the marker, so that the top line of the minicalendar looks like :



As we see below in the screenshots of the GridTemplate and output file below, the red series of tokens, was converted exactly as one would expect it to be for a DayValue of 1, based on the first date of the spread, January 6th 2003.




However, the second series of tokens (in black), is based on the internal date of the minicalendar. With the minicalendar marker [3mc-01] this means that the internal date is based on the month just before the date of DayValue 3 (January 8th 2003). Therefore the internal date of the minicalendar is December 1st, 2002 and the second series of tokens is converted to 1/12/2002.


What happens if one wants to place a token below then minicalendar marker, but not have it based on the internal date of the minicalendar ? In that case you should place that token in a separate textbox and use superimposition to make it look like that token is inside the minicalendar (for example, at the bottom).


Finally, there are some cases when you want a token to be evaluated using the internal date, but some formatting to be applied based on the relationship between the internal date and the GridTemplate's date. In those cases you would use a macro token which lets you relate both dates and display using one or both dates (see the section on s_ParentMinicalToken for a detailed example).

Topic 171850 updated on 13-May-2016.
Topic URL: