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.