DatePicker, DropDownDatePicker

DropDownDatePicker → dijit.form.DateTextBox

DropDownDatePicker has been replaced by dijit.form.DateTextBox. The API and functionality have been simplified, and the widget is now fully accessible, globalized, and skinnable. DateTextBox is a subclass of dijit.form.ValidationTextbox and behaves like other subclasses of that widget. It is intended to be used in forms. The date is now always submitted to the server using a profile of ISO8601 -- see dojo.date.stamp for details.

Parameter changes/deletions

Dojo 0.4Dojo 0.9Notes
iconURLdeletedpresentation of dropdown is customizable via CSS theming instead
formatLengthdeleteduse constraints.formatLength instead
displayFormatuse constraints.datePattern + selector
saveFormatdeletedNo longer a choice. See dojo.date.stamp for specifications
valuevaluenow contains a Javascript Date object only
displayWeeks, adjustWeeksdeletedno longer customizable
startDate/endDatedeleteduse constraints.min/max instead
weekStartsOndeletedmust use locale default
staticDisplaydeletedno longer an option

Method changes/deletions

Dojo 0.4Dojo 0.9Notes
getDate()use value attribute instead
getValue()use serialize instead
setValue()/setDate()use Date object for argument only
onValueChanged(), onInputChange()use onChange instead -- see dijit.form._FormWidget

Examples

DateTextBox class, Attributes: {lang: "en-us", required: true, trim: true}. Works for leap years

Besides the changes made to ValidationTextbox, the biggest change to the DateTextBox API is the universal value format. Listings 1 and 2 demonstrate the new 0.9 date syntax:

Listing 1. 0.4 DateTextBox syntax
<input type="text" name="date1" class="medium" value="12/30/05" lang="en-us"
	dojoType="DateTextBox"
	required="true" 
	invalidMessage="Invalid date. Use M/d/yy format." />
Listing 2. 0.9 DateTextBox syntax
<input id="q14b" type="text" name="date1" value="2005-12-30"
	dojoType="dijit.form.DateTextBox"
	lang="en-us"
	required="true"
	promptMessage="mm/dd/yyyy"
	invalidMessage="Invalid date. Use mm/dd/yyyy format." />

DatePicker

DatePicker has been replaced by dijit._Calendar but this widget is not meant to be used standalone because it does not provide accessibility to the visually or mobility impaired individual. Using the widget standalone is not currently supported because of this restriction. To provide access for all users, it is recommended that dijit.form.DateTextBox be used for input of dates.