Please enable JavaScript to view this site.

 

Property of the script line: Inserts.

 

Use this property to set complex rules for the occurrence of Inserts.

 

The Variable Dates property has exactly the same structure as the aeiou-Holidays, and is a list of Holidays Sets, except that one-time-dates are not included in the dates of the Variable Dates property.

 

This affords you the flexibility and power of holidays rules.

 

Insertions based on a week number

 

Though week numbers are never used in worldwide public holidays, it is possible to construct a recurring holiday rule that is based on the weekday of a given week number.

 

The example shown on the right is the rule for the Sunday of week 38.

 

To get to this rule, or any similar one, we follow the steps below:

 

1.The ISO definition of week number 1 is the week that contains the first Thursday of the year. To get the Monday of week 1, we can set a fixed date rule as follows "3 days before the Thursday on or after January 1".

2.To get the Monday of week 38, we add 7 times 37 days to that rule, to get "256 days after the Thursday on or after January 1".

3.Finally, to get the Sunday of week 38, we add 6 days to the above rule, to get get "262 days after the Thursday on or after January 1", as shown in the image on the right.

 

More generally, to get the weekday D of week W, where (D runs from 1-7 for Monday to Sunday), we can use the rule:

 

((7*(w-1))+(D-1)-3) days after the Thursday on or after January 1

 

where after is replaced by before if the value of ((7*(w-1))+(D-1)-3) is negative. For your convenience, the values of the above formula have been calculated and listed here, for the Monday of every week number from 1 to 52

 

See also: February 28, March 1st, dates (specific), dates (repeating), ignore sidedness, insert first page, insertion rule, skip insert.

 


Topic 066000, last updated on 16-Oct-2023