GWT: use DateTimeFormat on client and SimpleDateFormat on server

后端 未结 5 848
无人及你
无人及你 2020-12-17 09:34

I have a function that must work the same way on both client and server and it formats dates.

if (GWT.isClient())
{
  // Use DateTimeFormat
} else {
  // Use         


        
5条回答
  •  遥遥无期
    2020-12-17 10:08

    import com.google.gwt.i18n.shared.DateTimeFormat;
    DateTimeFormat fm = DateTimeFormat.getFormat("MM/dd");
    String st = fm.format(date);
    

提交回复
热议问题