WeekDay 파싱하는 부분
public enum Week {
SU("su", 0),
MO("mo", 1),
TU("tu", 2),
WE("we", 3),
TH("th", 4),
FR("fr", 5),
SA("sa", 6);
private String name;
private int val;
Week(String name, int val) {
this.name = name;
this.val = val;
}
public static int of(String name) {
return Week.valueOf(name.toUpperCase()).val;
}
}
달력을 검색하여 출력하는 부분
for (int i = 0; i < startWeek; i++) {
out.printf(" ");
}
int n = 1;
while (n <= maxDaysOfMonth) {
out.printf("%3d", n);
if ((startWeek + n) % 7 == 0) {
out.println();
}
n++;
}