Calendar Widget
Back to widget:type
Synopsis
The calendar widget is the default widget for editing date and datetime fields. It is javascript pop-up calendar that allows users to select date and time visually. It can be configured to allow different date and time formats, themes, starting days of the week, and more.

Usage
For DATE and DATETIME fields, the calendar widget is the default widget used, so you need not specify it explicitly in the fields.ini file. For other types of fields you may designate them to use the calendar widget in the fields.ini file as follows:
[my_field]
widget:type=calendar
Configuration Options
The calendar widget supports some configuration options that can be set in the fields.ini file. These options are as follows:
| Name | Description | Default | Version |
|---|---|---|---|
| widget:lang | The language to use for the calendar. This is a 2-digit ISO language code. | en | 0.5.3 |
| widget:theme | The theme to use for the calendar. It only ships with one theme at present. | calendar-win2k-2 | 0.5.3 |
| widget:firstDay | The first day of the week (e.g. Monday=1) | 1 | 0.5.3 |
| widget:showsTime | Boolean value indicating whether the calendar should show the time as well. | 0 for DATE fields, 1 for DATETIME fields. | 0.5.3 |
| widget:ifFormat | The input format of the date. This takes a formatting string as supported by the strftime function. | %Y-%m-%d %I:%M %P | 0.5.3 |
| widget:timeFormat | Whether to use 12 hour or 24 hour time format. | 12 | 0.5.3 |
Examples
Setting the time to use 24 hour format
In your fields.ini file:
[my_field]
wiget:type=calendar
widget:timeFormat = 24
See Also
- date Widget - A widget for editing date and time using select drop-down lists.
- time Widget - A widget for selecting time from a set of possibilities in a single select list.
var disqus_identifier = ‘xataface.com/wiki/calendar’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘http://xataface.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })(); blog comments powered by Disqus
//<![CDATA[ (function() { var links = document.getElementsByTagName(‘a’); var query = ‘?’; for(var i = 0; i < links.length; i++) { if(links[i].href.indexOf(‘#disqus_thread’) >= 0) { query += ‘url’ + i + ‘=’ + encodeURIComponent(links[i].href) + ‘&’; } } document.write(‘