Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Need help in setting mask as yyyyMMdd in dateItem

    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.

    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);
    			}
    
    		});
    this is the code i tried for masking which is not working as i want

    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);
    Can anyone pls help me.

    Thanks
    Last edited by agastya; 12 Jul 2010, 07:11.

    #2
    A date format without a separator is not currently supported.

    Comment

    Working...
    X