4
A
回答
3
0
爲DatePicker
的Javadoc有應該讓你開始一個例子 - 你只需要格式化使用一個ValueChangeHandler
DateTimeFormat
分配給您DatePicker
日期:
public class DatePickerExample implements EntryPoint {
public void onModuleLoad() {
// Create a date picker
DatePicker datePicker = new DatePicker();
final Label text = new Label();
// Set the value in the text box when the user selects a date
datePicker.addValueChangeHandler(new ValueChangeHandler() {
public void onValueChange(ValueChangeEvent event) {
Date date = event.getValue();
String dateString = DateTimeFormat.getMediumDateFormat().format(date);
text.setText(dateString);
}
});
// Set the default value
datePicker.setValue(new Date(), true);
// Add the widgets to the page
RootPanel.get().add(text);
RootPanel.get().add(datePicker);
}
}
這將在您的默認區域設置格式的日期 - 如果您想將其更改爲其他內容,請在GWT文檔中提供如何使用它的whole section。
0
GWT中的語言環境設置爲全局。
您可以設置本地例如在您的HTML文件中的meta標籤:
<html><head><meta name="gwt:property" content="locale=it">...
,你必須將語言環境添加到modulefile * .gwt.xml:
<extend-property name="locale" values="it"/>
的屬性定義如下:
COM .google.gwt.i18n.client.constants.DateTimeConstantsImpl_xx.properties
有關更多信息,請閱讀文檔。
相關問題
- 1. GWT:語言環境不變?
- 2. GWT語言環境變化
- 3. DatePicker添加語言環境jQuery
- 4. GWT添加新的語言環境,undefined.cache.js
- 5. NSDateFormatter語言環境
- 6. Symfony2語言環境
- 7. swprintf語言環境
- 8. java語言環境標記語言環境顯示名稱
- 9. Laravel使用語言環境的語言環境代碼
- 10. Facebook Javascript SDK語言環境語言
- 11. Android - 更改語言環境(語言)
- 12. 系統語言環境語言設置
- 13. Android:默認語言環境語言「hd」
- 14. 語言環境語言縮減器
- 15. Android語言環境語言支持
- 16. 如何使用Struts2 jQuery插件設置datepicker語言環境
- 17. Facebook JSON語言環境
- 18. 與特定語言環境
- 19. 語言環境切換器
- 20. NSDate語言環境問題
- 21. 更改BlackBerry語言環境
- 22. Android語言環境問題
- 23. Chart.js時刻語言環境
- 24. 貨幣,語言環境
- 25. number_to_currency語言環境轉換
- 26. DateTime語言環境設置
- 27. JSF語言環境例外
- 28. Towerjs語言環境錯誤
- 29. 從默認語言環境轉換爲英語語言環境的日期
- 30. GWT:從服務器端獲取語言環境信息?