Apparently, one has to transform the date into a JSON compatible shape. Lucky for us, Matthew has already provided us with such a method:
grailsUITagLibService.dateToJs(myDateObject)
Okay, parsing the String back to a date in the controller was hard work for me. What has been suggested by Matthew in his DemoController produces exceptions. I had to put some own effort into this:
else if(params.field == "date") { def simpleDateFormat = new java.text.SimpleDateFormat("E MMM dd yyyy HH:mm:ss ZZZZZZZ", Locale.ROOT); Date date = simpleDateFormat.parse(params.newValue) passage.date = date }
No comments:
Post a Comment