Snippet List
DateTimeWidget using [JSCal2](http://www.dynarch.com/projects/calendar/)
Duplicate of [this snippet](http://www.djangosnippets.org/snippets/391/), but for latest 1.5 version of DHTML Calendar.
Also here is **fixed problem of previous widget** linked to *form.changed_data* and *EntryLog.message*. This is fixed by adding own, little modified *_has_changed()* method
- datetime
- date
- calendar
- widget
- dhtml
This widget uses: [DHTML Calendar Widget](http://www.dynarch.com/projects/calendar/).
It is very simple implementation but may be easily extended/changed/refined.
1. Necessary files:
First download calendar package and extract it to your MEDIA folder (MEDIA/calendar/...)
You'll also need a small gif that will be shown as a button that allows user to display calendar. By default this 'gif' is searched at '[MEDIA]images/calbutton.gif' but you may change this path in the code (calbtn variable). You need to download or create callbutton.gif image by yourself (it is not included).
2. Include css and js files in your page (as shown in the comment in the code).
3. In form code assign a widget to a field as usual (see newforms documentation for more details).
4. It is possible to change date format by specifying different value for 'dformat' attribute of widget class.
If you get javascript errors while trying to open calendar try to use english translation file (calendar-en.js). I've found that some translations, eg. Polish, are broken by default. In this case you should override your language translation with english one and translate it by yourself (it is easy).
- datetime
- date
- calendar
- widget
- dhtml
2 snippets posted so far.