我想在GWT中将format设置为DateBox。
所需格式为dd/MM/yyyy。
我尝试使用:
DateTimeFormat dateFormat = DateTimeFormat.getFormat("dd/MM/yyyy");
dateBoxObj.setFormat(new DateBox.DefaultFormat(dateFormat));有什么帮助吗??
发布于 2015-03-28 10:19:37
交叉检查哪个DateTimeFormat你imported...Use这个com.google.gwt.i18n.client.DateTimeFormat...its,看起来像上面的代码应该可以工作...我也用过这个DatetimeFormat...像这样
Date date = event.getValue(); //Date from Selection
String dateString = DateTimeFormat.getFormat("MM/dd/yyyy").format(date);
textbox.setValue(dateString); //this date is in form of "MM/dd/yyyy"https://stackoverflow.com/questions/29295903
复制相似问题