Some Scheme code I wrote, once upon a time, to generate a calendar system for an SF world with two moons. The first has a roughly eight-day orbit on which is based the week analogue, and the second a roughly 30-day orbit on which is based the month analogue. Thus was my initial inspiration, and then I deliberately made it a little messy so the calendar would be a bit irregular (like Earth calendars), and then I set myself to figuring out what sorts of leap days the inhabitants of this would would've devised to rationalize their timekeeping.
This is dedicated to all calendar nerds everywhere (you know you're out there).