Introduction

This article will describe how to calculate the 1st, 2nd, 3rd, 4th, 5th and last weekdays of any month.
This will then be used to calculate the dates of various variable Calendar Events or Holidays.

The nth day of the month

Using the DayOfWeek() function described in the previous article
Born on the 4th of July we can create the following NthDay()
function to return the date of the nthweekday within the month of the
year:

The last day of the month

Using the makeArray() and LeapYear() functions and the daysofmonth[] and
daysofmonthLY[] arrays, described in the previous article Blind Date,
using the number of days within the month we can find the date of the last
weekday within the month of the year using the LastDay() function:

We can now call the NthDay() function to compute the first, second, third, fourth, fifth and last
weekday, making the LastDate() function obsolete. Along with the FullDate() function, described in the previous article
Monday's child is full of grace, we can calculate the dates as follows: