Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groovy/Grails: How do I make my datePicker blank or null by default instead of showing today's date?

That is basically my question. It is showing me today's date and not a blank or null or '' date, even if I put null or '' it runs perfectly but keeps showing me today's date, not a blank dropdown box. So I want to change the default to being blank when the gsp loads, not with today's date.

Thanks

like image 573
randomizertech Avatar asked Jun 25 '10 14:06

randomizertech


1 Answers

The usage of the attribute default is not documented in the Grails documentation but its functionality can be extracted from the implementation. Use the attribute default="none"to stop the datePicker from using the current date and provide an empty text as the noSelection value:

<g:datePicker default="none" noSelection="['':'']" />

More information about the attribute noSelection can be found in the Grails documentation.

like image 165
stefanglase Avatar answered Sep 22 '22 15:09

stefanglase