如何简单地向GWT中的DatePicker中添加更多年份,并在选择日期时使用DD-MM-YYYY格式?

如何简单地向GWT中的DatePicker中添加更多年份,并在选择日期时使用DD-MM-YYYY格式?,gwt,Gwt,看看这个代码 DateBox myDateBox=new DateBox(); myDateBox.getDatePicker().setYearAndMonthDropdownVisible(true); DateTimeFormat dateFormat = DateTimeFormat.getFormat("DD-MM-YYYY"); myDateBox.setFormat(new DateBox.DefaultFormat(dateFormat)); 好的,当我点击日期框时,日期选择器

看看这个代码

DateBox myDateBox=new DateBox();
myDateBox.getDatePicker().setYearAndMonthDropdownVisible(true);
DateTimeFormat dateFormat = DateTimeFormat.getFormat("DD-MM-YYYY");
myDateBox.setFormat(new DateBox.DefaultFormat(dateFormat));
好的,当我点击日期框时,日期选择器弹出,但我看不到1600年的年份,那么如何在日期选择器中添加更多的年份呢


您好,我想在选择日期时使用DD-MM-YYYY格式,但当单击日期时,日期框中没有显示任何内容?

对于1600年这样的年份,我帮不了您。但就格式而言,问题可能在于大写。我认为你应该使用这种格式

DateTimeFormat dateFormat = DateTimeFormat.getFormat("dd-MM-yyyy");