Determining Holidays
If the holiday is the same date each year, it's easy. Simply use a "Date" condition in an If-Then statement. In the date condition, specify the month and date of the month. For example, to know if it's New Year's Day, check the boxes for the month "January" and the date "1". This condition will only be true when the date is the first and the month is January. This is how it would appear in your schedule: If Date is: (Dates= 1) (Months= Jan) Then ;Do whatever you want End If Here are some of the holidays:
What if the date moves around each year? For example, Labor Day is the first Monday in September, and will occur on a different date each year. Here's how to handle this:
This condition will only be true on a Monday in September where the date is the first through the seventh. Since this is the definition of Labor Day, it will be true every Labor Day, but never on any other day. This is how it would appear in your schedule: If Date is: (Days= M) (Dates= 1,2,3,4,5,6,7) (Months= Sep) Then ;Do whatever you want End If This same method can be used for other holidays. The key is determining what
dates of the month the holiday can fall on. The following table shows some holidays that
move around each year:
Why isn't Easter listed? Well, Easter occurs on the first Sunday after a full moon on or after March 21. It can fall anywhere from March 22 to April 25. The only way to handle this is to get a calendar for the next several years and look up the dates. Then, enter separate If-Then statements for the actual date each year. To check the year, put the current year (its last two digits) into a variable, then check the value of the variable. For example, in 1996, Easter occurs on April 7. Here's how to enter the condition: Var #1 (Year) = current year If Var #1 (Year) = 96 And Date is: (Dates= 7) (Months= April) Then ;Do whatever you want End If There are a couple of different ways you can use these conditions in your HomeVision schedule:
|