Perpetual calendar

Specify the year and month to export the monthly calendar of the selected month.

Solution:

A B C D
1 2014 1  
2 =create(Sun,Mon,Tues,Wed,Thur,Fri,Sat) =A2.insert(0)  
3 =day@w(date(A1,B1,1))-1 =A2(A2.len())  
4 for days(date(A1,B1,1)) >A3+=1 >small=C2
5   if A3==8 >A2.insert(0)
6     >B3=A2(A2.len())
7     >A3=1
8   >B3.field(A3,A4)  

In A2, the resulting calendar is as follows: