I am using dateItem field with setUseTextField(true);
Now i want my date in a specific format , and for this purpose i have written following code.
But the DateItem is not working correctly means the derise format is not getting set, it is changing to incorrect format automatically. I think this is a bug of smratGwt.
Is anybody know how to fix this?
Now i want my date in a specific format , and for this purpose i have written following code.
But the DateItem is not working correctly means the derise format is not getting set, it is changing to incorrect format automatically. I think this is a bug of smratGwt.
Is anybody know how to fix this?
Code:
public static void setDateItemFormat(String dtFormat ){ DateUtil.setShortDateDisplayFormatter( new DateDisplayFormatter() { public String format(Date date) { try { if(date == null) return null; String DateTimeFormat dateFormatter = DateTimeFormat.getFormat(dtFormat); String format = dateFormatter.format(date); return format; } catch (Exception e) { e.printStackTrace(); return null; } } }); }
Comment