Indicates that a day (or a list of days) is a bank holiday. This bank holiday can correspond to a fixed date for a year, to a fixed date repeated every year or to a constant.
Remark: These bank holidays will be used:
- by the Calendar control.
- by the Organizer control.
- by the Scheduler control.
To find out whether a day is a bank holiday by programming, all you have to do is use BankHoliday
// Delete all bank holidays
// Initialize the 11 bank holidays common to the French regions and to the French territories
BankHolidayAdd("0101") // 1st of January
BankHolidayAdd(bhEasterMonday) // Easter Monday
BankHolidayAdd("0501") // 1st of May
BankHolidayAdd("0508") // 8th of May
BankHolidayAdd(bhAscensionDay) // Ascension day
BankHolidayAdd(bhWhitMonday) // Whit Monday
BankHolidayAdd("0714") // 14th of July
BankHolidayAdd("0815") // 15th of August (Assumption)
BankHolidayAdd("1101") // All Saints' Day
BankHolidayAdd("1111") // 11th of November
BankHolidayAdd("1225") // Christmas
// Add 2 additional bank holidays for the regions of Moselle and Alsace
BankHolidayAdd("1226" + CR + bhGoodFriday)
BankHolidayAdd(<New bank holidays>)
<New bank holidays>: Character string or Character String constant
Can correspond to:
- A date on 4 digits (in MMDD format) to define a bank holiday whose date is fixed over the years ("1225" for Christmas for example).
- A date on 8 digits (in YYYYMMDD format) to define a bank holiday for a specific year ("20080808" for the 8th of August 2008 for example).
- A date in the following format: <Month>_<Week number>_<Day number in the week>. For example: 11_2_3 for the 2nd Wednesday of November.
- One of the following constants:
Remark: The corresponding date corresponds to Easter + 39 days.
Remark: The corresponding date can be returned by Easter
Remark: The corresponding date corresponds to Easter + 1 day.
Remark: The corresponding date corresponds to Easter + 50 days.
Remark: The corresponding date corresponds to Easter - 2 days.
- a combination of the above-mentioned possibilities. The days found in this list must be separated by a CR character (carriage return).
- This function is used to customize the application according to the country and/or to the local regulations.
- This function has a global effect and it must be used at the beginning of the application.
- BankHoliday can be used after the call to BankHolidayAdd.
Unit examples (WINDEV): The Calendar control
Business / UI classification : Neutral code