< Home

Unobtrusive Datepicker for symfony - demo

A nice replacement for sfWidgetFormJqueryDate

Note: if you prefer to use jQuery UI, please take a look to datepicker UI instead.

Short story

To use with date selects named in symfony style (e.g. foo_day, foo_month, foo_year)

Just include datePicker.css stylesheet and javascripts: jquery, date methods, jquery-datePicker, datepicker

You must have this image in /images/calendar.png

Have fun! :-)

download (tbz, 41 Kb)

Demo

//
//
/
/ :

Long story

The story began when I got unsatisfied by sfWidgetFormJqueryDate, found in sfFormExtraPlugin. It has several issues:

Well, it's really an ugly solution.

So, I decided to write my own. I started from this demo and I wrote my implementation of this completely unobtrusive calendar. You can use it by simply adding the required stylesheet and javascripts: it will add automagically a nice calendar near each of your date selects (just on the right of the year). The calendar png image (courtesy of famfamfam) must be in /images/ directory (unless you want to edit datepicker.js). If you want a date select to be excluded (i.e., the calendar not diplayed beside it), just add a nocal class to year's select (see demo above). If you need localization, just include date_XX.js (e.g. date_it.js for Italian) after date.js. You can get it for many languages at jQuery date methods.

© 2009-2010 by Massimiliano Arione, released under LGPL. Last modified on 26 april 2010. symfony roma