- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
public enum MONTHS {
January(31), February(28), March(31), April(30), May(31), June(30), July(31), August(31), September(30), October(31), November(30), December(31);
private int days;
private MONTHS(int days){
this.days = days;
}
public int getDays() {
return days;
}
public void setDays(int days) {
this.days = days;
}
public static int getIndex(MONTHS month){
int i = 0;
for (MONTHS m : MONTHS.values()) {
if(m.equals(month)){
return i;
}
i++;
}
return 0;
}
}
Хоть код и GWT (нету j.u.Calendar), но все равно феерично, я считаю.