I have been tasked with making a 4-4-5 calendar for a retail reporting system (in javascript using moment.js but this shouldn't matter).
http://en.wikipedia.org/wiki/4-4-5_calendar
A 52 week year is divided in 4 * 13 week segments (4 + 4 + 5) - so far so good.
However as 52 weeks adds up to 364 days, and accounting for leap years, an extra week is added "roughly" every 5 years. In the link above it mentions 5.6 years.
So far I am thinking as follows:
Each year shifts 1 day, except a leap year which shifts 2. So depending on the start of the cycle:
2 + 1 + 1 + 1 + 2 = 7 (5 years) to shift 7 days.
1 + 1 + 1 + 2 + 1 + 1 = 7 (6 years)
1 + 1 + 2 + 1 + 1 + 1 = 7 (6 years)
1 + 2 + 1 + 1 + 1 + 2 = 8 (6 years)
So now I know every 23 years the shift is 29 days.
I am a little stuck as to where to go from here! Any help would be greatly appreciated.
The answer might well depend on what purpose the calendar will be put to. One solution is to avoid the entire extra day problem by simply extending the final week of the year by one or two days (depending on whether it is a leap year). This has the advantage that the "year" always begins on January 1, and the disadvantage that the "year" begins on different days in different calendar years.
If you are trying to use the calendar to predict traffic based on similar days in prior years, this might be a good approach. But if you want to use the calendar to analyze revenue, you might well want the extra day split out in some fashion, or the calendar modified as in the link you mentioned.
In addition to the advice in the other answer, I'd suggest that you also make sure that both you and the people who have asked you for this understand very clearly how it will (and will not) be used.