For Adobe ColdFusion application servers Calendar

Calendar assists the user in entering dates by providing a popup calendar. The calendar is an implementation of Matt Kruse's code and supports all of the CF5 and CFMX locales. To create a calendar in another language, you must set the locale (using SetLocale()) of the page before the opening cf_terraform tag. Calendar requires the ResourcePath attribute to be set correctly in your opening cf_terraform tag or your defaults.cfm settings file.

The following special attributes are available for Calendar:

  • DisabledDates (new in 2.5)
    Optional. Specify a list of dates or date ranges to exclude from selection. Place a colon between the two extrema of a range. For example: "2003-12-21:2004-1-15,2004-2-1" excludes the dates from December 21 2003 to January 15 2004, as well as the date February 1 2004. Note that manually entered dates within these ranges will not fail validation. For a simple range (e.g. a single minimum date and perhaps an end date), use the cf_terrafield attributes min and max. This will provide the same effect, and data validation will occur.
  • DisabledWeekdays
    Optional. Specify a list of days of the week to disable, where each day is referenced as a number from 0 (Sunday) to 6 (Saturday). Note that manually entered disabled days will not fail validation.
  • ButtonCaption
    Optional. The text to appear on the calendar button.
  • buttonPassthrough
    Optional. Attributes to pass through to the button tag to the right of the text input field. Remember to escape any double quotes (") or hashes / pound signs (#) by doubling them. See the second example below.
  • offsetX

    Optional (defaults to -152). X offset of the popup calendar based on the top left corner of the button. This attribute in comination with offsetY can be handy when trying to resolve select show-through issues.
  • offsetY

    Optional (defaults to 25). Y offset of the popup calendar based on the top left corner of the button.
  • PopupWindow
    Optional. If yes, open a popup window for the calendar, otherwise display as a DIV layer on the page. select boxes are notoriously poor at supporting dHTML, and shine through DIVs. If you have this problem on your form, you can either move the select box, or set the calendar to display in a popup window.
  • ShowYearNavigation
    Optional. If yes, Display arrows to allow you to click through entire years at a time.

Other non-TerraField attributes will be passed through to the underlying text tag (<input type="text">). For example:

  • style="border : 1px solid red"
  • readonly
  • onMouseOver="focus()"
  • class="sidebar"
  • title="My Title"

Examples

A regular Calendar field (the datatype is date by default):

<cf_terrafield
  name="Calendar1"
  format="calendar"
  caption="your arrival date"
  required="true"
  min="#Now()#"  
/>
<div>
  <cfoutput>
    #Request.TerraForm.DateHint#
  </cfoutput>
</div>
 *
month / day / year

A Calendar with serveral customisations:

<cf_terrafield
  name="Calendar2"
  format="calendar"
  caption="your departure date"
  required="true"
  caption=" Calendar"
  DisabledWeekdays="0,6"
  PopupWindow="Yes"
  ShowYearNavigation="Yes"
  buttonPassthrough="style=""background-color : white; border : 1px solid ##666666"""
/>

 *

Fields marked with  * are required.

Macromedia ColdFusion MX
ColdFusion web application server version 6 or later.
Paul said on 7/1/2004 at 8:48:12 AM:
Any plans to introduce and EnableDatesOnly attribute.

An example would be a list of event dates that would appear as selectable and all other dates not in this list would be unavailable.
Matthew said on 7/1/2004 at 3:16:37 PM:
No, but development is largely driven by what people ask for. I'll record that as one vote.