Chronodot - whens thanksgiving?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
widgetninja
 
Posts: 12
Joined: Mon Oct 21, 2013 1:39 pm

Chronodot - whens thanksgiving?

Post by widgetninja »

I am writing a program to control some neopixel lights on a neighborhood sign. Normally be a nice, boring white, but on holidays special colorschemes are presented. Easy for valentines, st patricks, new years etc. Not sure how to know when its thanksgiving or easter as those holidays 'roam' and are never on the same date.

Looking for insight on how to know when it is thanksgiving?

With the chronodot i know the month, day, year and day of the week it is (1-7).

Tanks for your help

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Chronodot - whens thanksgiving?

Post by adafruit_support_mike »

Calculating dates like Thanksgiving and Easter is enough of a challenge to rate its own page on Wikipedia:

https://en.wikipedia.org/wiki/Computus (just Easter)

If you want to handle multiple holidays, it's probably easier to build on the work of someone who has already built a library to handle such things. This one uses an XML config file to identify all the holidays and there restrictions, but you can backtrack your way through the calculations if you want:

http://www.codeproject.com/Articles/116 ... Calculator

If you just want Thanksgiving, this page has a fairly simple brute-force method:

http://phpave.com/calculate-thanksgivings-date/

widgetninja
 
Posts: 12
Joined: Mon Oct 21, 2013 1:39 pm

Re: Chronodot - whens thanksgiving?

Post by widgetninja »

Wow, thanks for the fast and helpful reply Mike!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”