Index: dojo-release-1.3.2-src/dijit/_Calendar.js =================================================================== --- dojo-release-1.3.2-src.orig/dijit/_Calendar.js 2009-09-04 11:21:12.000000000 -0700 +++ dojo-release-1.3.2-src/dijit/_Calendar.js 2009-09-04 11:22:24.000000000 -0700 @@ -96,6 +96,25 @@ node.appendChild(dojo.doc.createTextNode(text)); }, + // redraw UI with new value of firstDayOfWeek + repopulate: function(firstDayOfWeek) { + if (firstDayOfWeek) + this.attr('firstDayOfWeek', firstDayOfWeek); + + this._populateDayOfWeek(); + this._populateGrid(); + }, + + _populateDayOfWeek: function(){ + // insert localized day names in the header + var dayNames = dojo.date.locale.getNames('days', this.dayWidth, 'standAlone', this.lang); + var dayOffset = this.attr('firstDayOfWeek'); + + dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){ + this._setText(label, dayNames[(i + dayOffset) % 7]); + }, this); + }, + _populateGrid: function(){ // summary: // Fills in the calendar grid with each day (1-31) @@ -109,7 +128,8 @@ var today = new Date(); var selected = this.value; - var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang); + var dayOffset = this.attr('firstDayOfWeek'); + if(dayOffset > firstDay){ dayOffset -= 7; } // Iterate through dates in the calendar and fill in date numbers and style info @@ -195,6 +215,9 @@ postCreate: function(){ this.inherited(arguments); + if (!this.attr('firstDayOfWeek')) + this.attr('firstDayOfWeek', dojo.cldr.supplemental.getFirstDayOfWeek(this.lang)); + dojo.setSelectable(this.domNode, false); var cloneClass = dojo.hitch(this, function(clazz, n){ @@ -212,11 +235,7 @@ cloneClass(".dijitCalendarWeekTemplate", 5); // insert localized day names in the header - var dayNames = dojo.date.locale.getNames('days', this.dayWidth, 'standAlone', this.lang); - var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang); - dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){ - this._setText(label, dayNames[(i + dayOffset) % 7]); - }, this); + this._populateDayOfWeek(); // Fill in spacer element with all the month names (invisible) so that the maximum width will affect layout var monthNames = dojo.date.locale.getNames('months', 'wide', 'standAlone', this.lang); Index: dojo-release-1.3.2-src/dijit/form/_DateTimeTextBox.js =================================================================== --- dojo-release-1.3.2-src.orig/dijit/form/_DateTimeTextBox.js 2009-09-04 11:21:12.000000000 -0700 +++ dojo-release-1.3.2-src/dijit/form/_DateTimeTextBox.js 2009-09-04 11:22:24.000000000 -0700 @@ -113,6 +113,7 @@ if(!this._picker){ var PopupProto=dojo.getObject(this.popupClass, false); this._picker = new PopupProto({ + firstDayOfWeek: this.attr('firstDayOfWeek'), onValueSelected: function(value){ if(textBox._tabbingAway){ delete textBox._tabbingAway; @@ -190,6 +191,8 @@ postCreate: function(){ this.inherited(arguments); this.connect(this.focusNode, 'onkeypress', this._onKeyPress); + if (!this.attr('firstDayOfWeek')) + this.attr('firstDayOfWeek', dojo.cldr.supplemental.getFirstDayOfWeek(this.lang)); }, _onKeyPress: function(/*Event*/ e){