I haven't go time to look further right now, but will be back later.
In the meantime, it *SOUNDS* like the same problem I has with zero-based vs. 1-base years.
I *think* your answer will be to pull the same trick I did:
var nines = Math.floor( ( nDays - 1 ) / 2557 );
nDays -= nines * 2557;
var yrs = 9 * nines;
And then use subtraction, as I did, to find the right year in the last set of 9 years,
I know it feels clumsy, but it solves the zero-based vs. one-based problem.