PDA

View Full Version : Problem in DateField


shajeerkt
06-23-2009, 06: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
06-24-2009, 12:08 AM
Any one please help as my further work depends on this date field .

Thanks,

micgala
06-24-2009, 05: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.