首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GWT DateBox格式

GWT DateBox格式
EN

Stack Overflow用户
提问于 2015-03-27 16:05:46
回答 1查看 1.8K关注 0票数 1

我想在GWT中将format设置为DateBox。

所需格式为dd/MM/yyyy

我尝试使用:

代码语言:javascript
复制
DateTimeFormat dateFormat = DateTimeFormat.getFormat("dd/MM/yyyy");
dateBoxObj.setFormat(new DateBox.DefaultFormat(dateFormat));

有什么帮助吗??

EN

回答 1

Stack Overflow用户

发布于 2015-03-28 10:19:37

交叉检查哪个DateTimeFormat你imported...Use这个com.google.gwt.i18n.client.DateTimeFormat...its,看起来像上面的代码应该可以工作...我也用过这个DatetimeFormat...像这样

代码语言:javascript
复制
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"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29295903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档