I have a dateItem working fine with a European Short Date format: dd/MM/yy. and dateItem.setUseTextField(true). But if I set dateItem.setUseMask(true) the mask prevents the first digit of the day to be higher than 2.
For example, I can enter 19/05/2010 w/o a problem, but I cannot enter 20/05/2010. If I select the same date (20/05/2010) from the calendar popup the value that is shown is "0/05/2010".
Here is how I set the Date Format in my Entry Class
And here is how I set the DateItem
- Thanks
For example, I can enter 19/05/2010 w/o a problem, but I cannot enter 20/05/2010. If I select the same date (20/05/2010) from the calendar popup the value that is shown is "0/05/2010".
Here is how I set the Date Format in my Entry Class
Code:
// Set Default Formatting for Date Fields DateUtil .setShortDateDisplayFormat(DateDisplayFormat.TOEUROPEANSHORTDATE); DateUtil.setDateInputFormatter(new DateInputFormatter() { @Override public Date parse(String dateString) { try { final DateTimeFormat dateFormatter = DateTimeFormat .getFormat("dd/MM/yy"); Date date = dateFormatter.parse(dateString); return date; } catch (Exception e) { return null; } } });
Code:
dateProcess.setTitle("Fecha Proceso"); dateProcess.setUseTextField(true); dateProcess.setUseMask(true); dateProcess.setRequired(true); dateProcess.setEnforceDate(true);
Comment