Opened 9 years ago

Closed 6 years ago

#16637 closed enhancement (patchwelcome)

DateTextBox: reflect changes to <input> to Calendar while dropdown open

Reported by: igilfanov Owned by:
Priority: low Milestone: 1.13
Component: Dijit - Form Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:


	"dojo/_base/declare", // declare
], function(declare, Calendar, _DateTimeTextBox){

	// module:
	//		dijit/form/DateTextBox

	return declare("dijit.form.DateTextBox", _DateTimeTextBox, {
		// summary:
		//		A validating, serializable, range-bound date text box with a drop down calendar
		// example:
		// |	new DateTextBox({value: new Date(2009, 0, 20)})
		// example:
		// |	<input data-dojo-type='dijit/form/DateTextBox' value='2009-01-20'>

		baseClass: "dijitTextBox dijitComboBox dijitDateTextBox",
		popupClass: Calendar,
		_selector: "date",

		// value: Date
		//		The value of this widget as a JavaScript Date object, with only year/month/day specified.
		//		If specified in markup, use the format specified in `stamp.fromISOString`.
		//		set("value", ...) accepts either a Date object or a string.
		value: new Date(""),	// value.toString()="NaN"

		validator: function(/*anything*/ value, /*__Constraints*/ constraints){
			var isValid = (new RegExp("^(?:" + this._getPatternAttr(constraints) + ")"+(this.required?"":"?")+"$")).test(value) &&
				(!this.required || !this._isEmpty(value)) &&
				(this._isEmpty(value) || this.parse(value, constraints) !== undefined); // Boolean

			if(this.dropDown && isValid ==true){
				this.dropDown.set('value', this.parse(value, constraints), false);

			return isValid;


Change History (8)

comment:1 Changed 9 years ago by Douglas Hays

Owner: changed from Douglas Hays to igilfanov
Status: newpending

Please explain what you're trying to accomplish and how this is better than the current DateTextBox?.

comment:2 Changed 9 years ago by igilfanov

Status: pendingnew

During a set date in the textbox when case of an open calendar, automatically select the date in the calendar. Similar to jQuery UI Datepicker opportunities.

comment:3 Changed 9 years ago by igilfanov

Please activate this enhancement starting with the new version 1.8.4

Last edited 9 years ago by igilfanov (previous) (diff)

comment:4 Changed 9 years ago by bill

I think if you type in a date and then open the dropdown it already selects that date. I guess you want it to select the date as the user is type? This enhancement doesn't seem very useful.

comment:5 Changed 9 years ago by igilfanov

Then the choice of the year to become more exhausting. I wish that the date is automatically set in the calendar when you opened the dropdown, while the user types in the textbox. This enhancement very useful.

comment:6 Changed 9 years ago by bill

Owner: changed from igilfanov to Douglas Hays
Priority: undecidedlow
Status: newassigned
Summary: Automatic selection of the date on the calendar when you enter a date in the field.DateTextBox: reflect changes to <input> to Calendar while dropdown open

I wouldn't use the word exhausting. If for example:

  1. open the drop down
  2. change the date from 1/1/2000 to 1/1/1900

Then to reflect the change from 2000 --> 1900 into the calendar, you need to close and reopen the drop down. I suppose it would be marginally nicer if you didn't need to do that, but not sure if it's worth the effort in dijit.


comment:7 Changed 8 years ago by Douglas Hays

Owner: Douglas Hays deleted
Status: assignedopen

comment:8 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: openclosed

Given that no one has shown interest in creating a patch in the past 2+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.