I'm looking for a calendar component for my Grails app. I'm aware that Grails already has the g:datePicker
, but it's a bit primitive and not very visually appealing.
I've had a look on the contribute-a-tag page and in the grails plugin portals and there's a wide range of options. Rather than trying them all out, I'd be very grateful if anyone could recommend one in particular. My requirements are:
- Must allow selection of a date and time, e.g. 9AM on 24 March 2010
- Should be easy to bind to a domain object property of type Date and display any validation errors in UI开发者_开发问答
- I'd prefer something based on JQuery, but I'm open to alternatives.
I'm really just looking for something that will allow the user to easily choose a particular point in time, rather than a fully-featured calendar like JQuery Calendar.
Cheers, Don
You have two popular options: GrailsUI has a date picker (see the very end of the page), and so does RichUI. They both use YUI, but RichUI uses some more libraries for stuff like timeline, calendar view and such. I've only used GrailsUI so far, and the one thing to look out for is to use the proper body style class in your "grails-app\views\layouts\main.gsp":
<body class="yui-skin-sam">
I know this may be a little bit late but I have forked a project called glDatePicker and added some time picker functionality. Check it out https://github.com/dfisch/glDatePicker
If you want something JQuery based, you could check out JQueryUI (http://jqueryui.com/datepicker/). It can be complex if you want it to be, but is generally very simple and thus I think fits with what you want. There is an existing grails plugin in for it already as well
精彩评论