How to default the date in gsp to a specific format.

29 views
Skip to first unread message

Megs

unread,
Sep 20, 2010, 8:47:58 AM9/20/10
to Bangalore Users of Groovy (BUG)
Hi,

I am using the rich ui date chooser in my gsp for selection of dates.
However , once I enter the value, the date gets passed to the
controller in the format Thu Jul 29 00:00:00
EDT 2010.
Is there a way to can default the date to a specific format in the
application.
I believe g:formatDate format="yyyy-MM-dd" date="$
{empDt}"/> tag works. But how do i embed this in the gsp code?

Any inputs??

Thanks,
Megs

Saager Mhatre

unread,
Sep 21, 2010, 12:43:40 AM9/21/10
to bangalor...@googlegroups.com
your controller gets a j.u.Date object and not a j.l.String representing the date
i believe this is the input processing phase; you shouldn't have to worry about formats here as the taglibs handle the conversion for you
- dexter
Reply all
Reply to author
Forward
0 new messages