Skip to main content

Posts

Showing posts with the label easter sunday nerd dynamics ax 2012

Calculating easter sunday in different ways

Once a long time ago I found an interesting document on the inter web, describing different calendar systems. From that I made a php-class for my website that can calculate easter sunday in the gregorian calendar. Then it is easy to calculate the rest of the danish holidays as they are offset according to easter sunday (except of course those that have a fixed date). I translated that class in to x++. You can find it here: https://onedrive.live.com/redir?resid=9B63D38F981FFD1B!39710&authkey=!ABv0yYPULV3ReIE&ithint=file%2cxpo Today I got talking with a colleague about calculating easter sunday so he mentioned that he had also made a version of the calculation: http://stackoverflow.com/questions/11048524/how-to-calculate-easter-sunday-in-x So of course - being a bit nerdy - we just *had* to check if the routines arrived at the same result. So we came up with: static void EasterTest(Args _args) {     Yr x;     date easter(Yr yr) // Påskedag / påske sønd