zaphod Posted July 3, 2020 Share Posted July 3, 2020 I want to programmatically determine holidays to treat them like weekends where I turn on certain devices, like my outdoor water heater. I believe that you can buy a Chowmain driver that tells you when it is a holiday in several countries, but I don't want to pay to do something rather simple which is to determine the summer holidays in Canada. Let's use Labour Day as an example. It is the same in Canada as in the US and is on the first Monday in September. Would this be the correct logic? If month = September If day of the month is <= 7 If day of the week is = Monday IsHoliday= True I was thinking of setting up some code like this that would run just after midnight each day to set a holiday boolean variable. You would then reset it back to false at the top of this code. The other way of doing this is the "dumb" brute force method of hardcoding the dates for the next few years, as in If date = 9/6/2020 IsHoliday = True Any other recommendations? Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted July 3, 2020 Share Posted July 3, 2020 Your first option seems to be more sustainable. The indenting is wrong but I am sure you know that! I guess that another option would be to link in to one of the calendar drivers... but that would again involve payment. Quote Link to comment Share on other sites More sharing options...
Neo1738 Posted July 9, 2020 Share Posted July 9, 2020 Shivam's calendar driver is pretty great. Announces 35 min before a shift where I'm working and that I have work. Won't show up to the wrong place again! (I work at like 9 hospitals) Quote Link to comment Share on other sites More sharing options...
zaphod Posted July 9, 2020 Author Share Posted July 9, 2020 Where do you get Shivam's calendar driver? I am assuming you feed it by the calendar from something like your Google or Office 365 calendar? Quote Link to comment Share on other sites More sharing options...
msgreenf Posted July 9, 2020 Share Posted July 9, 2020 https://www.blackwiredesigns.com/jooced/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.