DEV Community

Cover image for A decimal calendar is a terrible idea
Michel Billard
Michel Billard

Posted on

A decimal calendar is a terrible idea

I was thinking about a decimal clock as totally normal people sometimes do and eventually ended up doing some research about a decimal calendar.

Why is a decimal calendar a terrible idea

You're probably aware that a year has 365 days (or 365 days, 5 hours, 48 minutes, and 46 seconds to be more precise) which is not easily divisible by 10.

Do you divide the year into 10 months of ~36 days? Do you then have 10 weeks of 3.6 days? Or 3 weeks of 10 days? You could keep the 12 months (which doesn't really make it a decimal calendar, does it?) each with 3 weeks of 10 days. You then need a special week at the end of the year for the extra 5 (or 6) days.

Either way, a decimal calendar is way too impractical and not a good idea.

What about other calendar systems?

Now that we can work with. Throughout my research (which consisted of this Wikipedia page about the calendar reform) I found two interesting proposals. The World Calendar and the International Fixed Calendar which are both perennial calendars, meaning they don't change year to year. November 9 is always a Thursday on the World Calendar and a Monday on the International Fixed Calendar.

Finding what today is on those calendars

That got me thinking about how you could figure out where a specific date landed on one of those two calendars and then I went coding.

The gist of it is quite simple:

  • Calculate which day of the year we're at (ex: 200th day)
  • Calculate which date corresponds to that day on the other calendar

There are some quirks to workaround obviously since those calendars still have to deal with leap years and both have an extra day at the end of the year because 365 days is still not divisible in nice regular chunks.

For the International Fixed Calendar the logic is relatively simple (this code doesn't include the logic for the leap year):

// diffDays is the number of days since the beginning of the year
const dayNumber = (diffDays % 28) + 1;
const dayName = WEEKDAYS[diffDays % 7];
const monthName = MONTHS[Math.floor(diffDays / 28)];
Enter fullscreen mode Exit fullscreen mode

For the World Calendar it's a little more complex because some months have 31 days and others 30 days. So the logic goes like this:

  • Find the quarter
  • Find the month in the quarter
  • Find the day in the quarter
// Determine the month index within the quarter (91 days per quarter)
// and the day of that month (months of 31, 30, and 30 days respectively)
let monthIndex = 0;
let dayNumber = (diffDays % 91) + 1;
if (dayNumber > 31 && dayNumber <= 61) {
  monthIndex = 1;
  dayNumber -= 31;
} else if (dayNumber > 61) {
  monthIndex = 2;
  dayNumber -= 61;
}

const zeroBasedQuarter = Math.floor(diffDays / 91);
const monthName = MONTHS[zeroBasedQuarter * 3 + monthIndex];

const dayName = WEEKDAYS[diffDays % 7];
Enter fullscreen mode Exit fullscreen mode

...and that's pretty much it!

You can find the results on a website I made to show the results and let you check when your birthday is on those calendars.

There's also a decimal clock if you want to check that out too.

Top comments (0)