What I'd really like is to have a jquery datepicker field type for date based search parameters, but I figured it would be outside of the scope of this project to add such functionality. Therefore I can build the integration myself and perhaps even document it for others, but I'll need to be able to assign class names to parameter fields so that I can link the jquery datepicker to these elements appropriately.

Comments

metzlerd’s picture

We've been interested in this functionality as well, so I'd really be interested in hearing about approach you might be using. In the past There has been some chatter on this anyway because there is also a desire to support entry of multiple date formats as well. Some of this could be handled with a form_alter hook, but I'm interested in tackling this more generally as well.

Did you have something in mind for implementation details here?

ptillman’s picture

The most general approach would likely be to require the libraries module, along with the jquery datepicker library. If those 2 are available, then a new input control type would be listed for jquery datepicker. You could inject the library and the init code to make the datepicker work easily in a module. The only challenge I see in creating a full fledged integration, although I'm sure just a few minutes thinking it through would lead to a solution, is providing the user with the ability to modify the datepicker parameters (perhaps a admin config page?). http://jqueryui.com/demos/datepicker/

I've implemented this on my site for now, but I'm just using the default id given to the field and injecting the js and init code via template.php

metzlerd’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
metzlerd’s picture

Assigned: Unassigned » metzlerd
Status: Active » Fixed

The ability to add classes to the parameter form has been added to 7.x-3.x-dev branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.