We can construct an "eternal" calendar program, which is based on the assumption that the calendar started in 3409, and changes generation every 476 years. The program goes, automatically, to generation 5 in our days. Here is the
complete program,
which regenerates the output of
this post. The "eternal" calendar behaves fine, as you can verify yourself, from year 4000 to year 8000.