Hi,
Can anyone help in setting up the mask for text typing in DateItem as yyyyMMdd. i wrote these functions setNormalDateDisplayFormatter and setShortDateDisplayFormatter. But they are working only for picker.
this is the code i tried for masking which is not working as i want
Can anyone pls help me.
Thanks
Can anyone help in setting up the mask for text typing in DateItem as yyyyMMdd. i wrote these functions setNormalDateDisplayFormatter and setShortDateDisplayFormatter. But they are working only for picker.
Code:
DateUtil.setNormalDateDisplayFormatter(new DateDisplayFormatter() {
public String format(Date date) {
if (date == null) {
return null;
}
return DateTimeFormat.getFormat("yyyyMMdd").format(date);
}
});
DateUtil.setShortDateDisplayFormatter(new DateDisplayFormatter() {
public String format(Date date) {
if (date == null) {
return null;
}
return DateTimeFormat.getFormat("yyyyMMdd").format(date);
}
});
Code:
DateItem date = new DateItem();
date.setTitle("Loan Date*");
date.setUseTextField(true);
date.setDateFormatter(DateDisplayFormat.TOJAPANSHORTDATE );
date.setMaskDateSeparator("");//i tried with null and ""
date.setUseMask(true);
Thanks
Comment