
So I am just adapting this calendar of Faerun for use in Tellene (the world of hackmaster). Which has 3 moons, a 28 day cycle. 34 day cycle and an 80 day cycle in a 364 day calendar. I am just trying to figure out what this person did for the moon cycles (the code in question is 437-472 if you look at the github) <a href="https://github.com/Ciorstaidh/Roll20-API/blob/master/Faerun%20Calendar%20v2.4" rel="nofollow">https://github.com/Ciorstaidh/Roll20-API/blob/master/Faerun%20Calendar%20v2.4</a> The lines in question that I am referring to is this section. getmoonV = function() { var ordinal = state.Calendar.now.ordinal; var moonNo; var moon; moonNo = Math.ceil(ordinal/3)-Math.floor(Math.ceil(ordinal/3)/8)*8; switch(moonNo) { case 1: moon = 'First Quarter'; break; case 2: moon = 'Waxing Cresent'; break; case 3: moon = 'New'; break; case 4: moon = 'Waning Cresent'; break; case 5: moon = 'Third Quarter'; break; case 6: moon = 'Waning Gibbous'; break; case 7: moon = 'Full'; break; case 0: moon = 'Waxing Gibbous'; break; } return moon; }, So the question for me is how is moonNo calculated? I get dividing by 8 to get the 8 cases, but why is ordinal being divided by 3? Ordinal is the count of days from the 1st day of the year, and I know the moon of Faerun has a 30 day cycle.