PDA

View Full Version : Problem in DateField



shajeerkt
23 Jun 2009, 3:25 AM
Dear all,

Need a help .


date.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd.MM.yyyy"));
date.addListener(Events.Change, new Listener<FieldEvent>(){

public void handleEvent(FieldEvent be) {

Window.alert("change: " + be.value);

}

});From the above code i am getting an output value as ,for eg,
"wed Jun 10 00:00:00 AST 2009"

But i need a different date format like dd.MM.yyyy . How to do this? .
I am using this date as a where case for filtering my grid values .

Any help will be appreciated .

shajeerkt
23 Jun 2009, 9:08 PM
Any one please help as my further work depends on this date field .

Thanks,

micgala
24 Jun 2009, 2:03 AM
be.value is an object.
You should cast it to Date, and use DateFormat on that, so then it will return you an String on the format you desire.
Then you can display that string.