dijit._Calendar.postCreate
dojo.require("dijit._Calendar");
defined in dijit/_Calendar.js
Usage
function () (view source)
this.inherited(arguments); var cloneClass = dojo.hitch(this, function(clazz, n){ var template = dojo.query(clazz, this.domNode)[0]; for(var i=0; i<n; i++){ template.parentNode.appendChild(template.cloneNode(true)); } }); // clone the day label and calendar day templates 6 times to make 7 columns cloneClass(".dijitCalendarDayLabelTemplate", 6); cloneClass(".dijitCalendarDateTemplate", 6); // now make 6 week rows 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); // 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); dojo.forEach(monthNames, function(name){ var monthSpacer = dojo.doc.createElement("div"); this._setText(monthSpacer, name); this.monthLabelSpacer.appendChild(monthSpacer); }, this); this.value = null; this.setValue(new Date());