Everything sent from the view is a string, so params.fromDate as Date does not work.
In grails 2.x, the date method is added to the params object, which allows easy, null-safe parsing of dates, for example
def dateval = params.date('fromDate', 'dd-MM-yyyy')
or you can also pass a list of date formats, for example
def dateval = params.date('fromDate', ['yyyy-MM-dd', 'yyyyMMdd', 'yyMMdd'])
or the format can be read from messages.properties using the date.myDate.format key and use the parameter date method as
def dateval = params.date('fromDate')
source share