Как я могу получить названия месяца / дня недели в GWT?
Я пытаюсь это так, но должно быть лучшее решение для этой проблемы (я надеюсь :)):
public String getLocalizedName() {
switch( this ) {
case Januar:
return getMonth( 1 );
case February:
return getMonth( 2 );
case March:
return getMonth( 3 );
case April:
return getMonth( 4 );
case May:
return getMonth( 5 );
case June:
return getMonth( 6 );
case July:
return getMonth( 7 );
case August:
return getMonth( 8 );
case September:
return getMonth( 9 );
case October:
return getMonth( 10 );
case November:
return getMonth( 11 );
case December:
return getMonth( 12 );
}
return "";
}
private String getMonth( int month ) {
return DateTimeFormat.getFormat( DateTimeFormat.PredefinedFormat.MONTH_ABBR ).format( new Date( 2011, month, 1 ) );
}