DateUserを参考に日付を和暦(元号)で表示する。(Java6)
public class DateUserWAREKI implements TypeConverter {
@Override
public Object coerceToBean(Object arg0, Component arg1) {
// TODO Auto-generated method stub
return null;
}
@Override
public Object coerceToUi(Object arg0, Component arg1) {
if (arg0 == null) {
return null;
}
Locale locale = Locale("ja","JP","JP");
SimpleDateFormat sdf = new SimpleDateFormat("GGGGyy年M月d日", locale);
Date date = (Date) arg0;
return sdf.format(date);
}
}
<listcell label="@{employee.hireDate, converter='org.zkforge.converters.DateUserWAREKI'}"/>
0 件のコメント:
コメントを投稿