I don't have the source code of this site, but checking if a calendar can be used again is pretty easy.
1. Check which weekday the year starts
2. Check if this year is a leap year.
If the year starts on the same weekday as another year and the leap-yeariness is the same, the year is the same.
With this info it's really easy to use your favorite date library to check which years match, but you can also do that manually.
Each year starts on the next weekday that the previous year did. (2019-01-01 was a Tuesday, 2020-01-01 will be a Wednesday) except when that previous year was a leap year. In that case one day is skipped.
Edit:ninja'd by jcranmer