I am trying to bind date parameters in my controller. I read somewhere that this should be enough if I have a date in format yyyy-MM-dd HH:mm:ss.S. But that does not work. Another option, which I read was to add tags _day, _month, _yearetc. To the attributes I want to parse, but this method also doesn't work.
So, this is basically a one-to-many relationship when there is a date on many sides (the action has a VisitList<Visit>date of visit).
class Action {
List<Visit> visitList
static hasMany = [visitList: Visit]
}
class Visit {
Action action
static belongsTo = [action: Action]
Date date
String description
}
I analyze all the parameters for the action instance as follows:
def save(){
Action actionInstance = new Action()
action.properties = params
action.save()
}
The date is sent from the view and has this format:
visitList[0].date=2012-05-15 00:00:00.0000
But the date is still zero. A visit also has a description attribute, and it works well. Parameter for this attribute:
visitList[0].description=description
.