Please enable JavaScript to view this site.

 

Navigation: Tokens > MiniCalendar Tokens

Changing a Minicalendar Date with a Macro

Scroll Prev Up Next More
The elements contained in a mini-calendar will be based on the date of the mini-calendar marker and the offset that it contains.

 

For example, in the grid on the right, if the date corresponding to DayValue 4 is March 25th, then the mini-calendar on the right will display the month of April because the +01 in the [4mc+01] mini-calendar marker tells Q++Studio that the mini-calendar should display the month following (+1) the month of the date corresponding to DayValue 4.

 

This notation satisfies the needs of mini-calendars displayed in 99% of diaries, because the month that is displayed in mini-calendars usually follows that very pattern.

 

However, suppose you need to be able to calculate the date used to base a mini-calendar based on a more complex rule than "based on the date of DayValue X".

 

To do this you would place a macro token that precedes the mini-calendar marker, as shown below.

 

In the macro that you would associate with this macro token ([1*5shift_mc] in the above example) you would calculate the date on which the mini-calendar should be based, and assign that date to the system variable nResult.

 

Then, in the Resulting Actions of the macros options that correspond to the *5 macros of that particular script you would then use the following settings shown on the right.

 

This allows you to specify the most complex rules for the month to be displayed in mini-calendars.

 


Topic 173790, last updated on 06-Sep-2022