[sw] : Start of Week Token

Navigation:  Tokens > Week Tokens >

[sw] : Start of Week Token

Previous pageReturn to chapter overviewNext page

Use the token [sw] (and related tokens) if you wish any of the week tokens to appear only at the beginning of the week, and to be blank on the other days. Note that this is not a zap token; blank means no text.

 

On Monday August 1st, [sw] = 30, and in English [sWeek] = Week.

 

Tuesday August 2nd, [sw], [sWk], [sWeek] are all blank.

 

One way to use the [sw] token is in a daily diary where you only want the week number to appear at the beginning of a new week. For example the 2 tokens [sWeek] [sw] would be blank on any day except at the beginning of the week, where they would combine to give 'Week 34'.

 

You can specify that the [sw] token should appear on a different weekday than Monday by adding the :0X suffix to the [sw] token, where X can be any number from 1 (Monday) to 7 (Sunday), or by using the [sw] Token GridOptions.

 

Special cases

 

I some cases, you might want to show the week number on the first day of some months as well as the first day of the week. This is quite common in monthly grids such as the one below.

 

The above is done by adding a colon ":" and a character at the end of the token.

 

Character

Example

Description

m

[sw:m]

Show the week number on the first day of the week and also on the first day of every month.

3

[sWeek:3]

Show the translation of the word "week" on the first day of the week and also on the first day of every 3 months.

6

[sWk:6]

Show the abbreviated form of the translation of the word "week" on the first day of the week and also on the first day of every 6 months.

y

[sw:y]

Show the week number on the first day of the week and also on the first day of the year.

 

Moving the position of the week number based on other events

 

You can use :~ suffixes to move the week number from its default position, usually Monday, to the first available place that has a certain number of days without any other event occurring (such as holidays or moon phases, for example).

 

The structure of these suffixes is:

 

 :~ DayCount_SetOfEvents

or

 :~ DayCount-SetOfEvents

or

 :~ DayCount/SetOfEvents

 

where

 

DayCount

This is a number from 1 to 7 indicating how many days, including the current one, must not contain any event from the SetOfEvents to display a week number.

 

If no number is specified, then the default value of 1 is assumed (ie. the week number will be displayed on the 1st day that does not contain any event from the SetOfEvents) and no underscore should be used.

_ - /

These 3 variations only have an effect for weeks that are split across 2 months.

 

Using an underscore "_" means that the search for a period of DayCount free days starts no earlier than the first of the month. This means that some week numbers may never be displayed if there is not enough room to display them at the end of the previous month.

 

in the token [sw:~2_67ae] using "_" does not display week number 40 at all, since the beginning of the month does not contain that week's Monday

in the token [sw:~2_67ae] using "_" does not display week number 40 at all, since the beginning of the month does not contain that week's Monday

Using a hyphen "-" means that the search for a period of DayCount free days starts at the beginning of the week, even if this means starting the search at the end of the previous month. This guarantees that, unless the SetOfEvents is particularly extended, each week number will appear once (this option guarantees that a week number will never appear 2 times).

 

in the token [sw:~2-67ae] using "-" displays week number 40 at the beginning of the month despite that week's Monday not being in that month, ensuring that each week number appears once

in the token [sw:~2-67ae] using "-" displays week number 40 at the beginning of the month despite that week's Monday not being in that month, ensuring that each week number appears once

Using a front-slash "/" means that, in addition to searching for a period of DayCount free days in the first pasrt of the week, at the end of a month, the search for a period of DayCount free days will start again at the beginning of the following month, the second part of the week. This means that, if possible, the week numbers of all weeks that contain a change of month, will appear twice.

in the token [sw:~2/67ae] using "/" displays week number 31 twice as there is enough space

in the token [sw:~2/67ae] using "/" displays week number 31 twice as there is enough space

SetOfEvents

This is a series of letters corresponding to the various events that may cause a diary design to require the week number to be moved by one or more days. These letters are the same as those used in holidays response tokens, and are as follows:

 

a e i o u

Corresponds to the [fa]..[fu] holidays name token.

â ê î ô û

Corresponds to the [â]..[û] holidays symbols token.

à è ì ò ù

Corresponds to the [fâ]..[fû] holidays abbreviation token.

á é í ó ú

Corresponds to the watermark token.

ä ë ï ö ü

Corresponds to the Saints tokens.

m

Corresponds to the Moon phase token [mp] (calculated using the first Moon Data Source)

s

Corresponds to the Season token [se] (calculated using the first Sun Data Source)

z

Corresponds to the Sun in Zodiac token [sz] (calculated using the first Sun Data Source)

1234567

Corresponds to weekdays (1=Monday ... 7=Sunday)

 

Finally, note that Q++Studio lets you decide, for each DiaryGridLine, what the first day of the week is, using the property option Week Starts on.


Topic 87052 updated on 03-May-2018.
Topic URL: https://www.qppstudio.net/webhelp_xv4/index.html?_sw__conditionalweektokens.htm