calendar reuse

If you're a cheap b*d like myself, use this script to print a list of old calendars which can be used again rvb

reference: http://webexhibits.org/calendars/year-definitions.html


array set R {0 {28} 1 {6 17 28} 2 {11 17 28} 3 {11 22 28}}
set this_year [clock format [clock seconds] -format %Y]
set last_year 2040
    
for {set year [expr {$this_year - 28}]} {$year < $last_year} {incr year} {
    foreach r $R([expr {$year % 4}]) {
        lappend Y([expr {$year + $r}]) $year
    }
}

catch {console show}
catch {wm withdraw .}

for {set year $this_year} {$year <= $last_year} {incr year} {
    puts "$year : $Y($year)"
}