function postCreate() {
            logger.debug(this.id + ".postCreate");

            if (this.readOnly || this.get("disabled") || this.readonly) {
                this._readOnly = true;
            }

            this._dateRangePickerButton = $(this.domNode)
                .find("button.mx-dateinput-select-button")
                .first()
                .get(0);
            $(this._dateRangePickerButton).attr("title", this.iconTooltip);

            this._dateRangePicker = $(this.domNode)
                .find("input.mx-dateinput-input")
                .first()
                .get(0);

            this._setParams();
			
			//init daterange picker
			 $(this._dateRangePicker).daterangepicker(this.params);
			
			var drpData = $(this._dateRangePicker).data('daterangepicker');
			
			//set initial start and end date, to be used for clearing the calendar
			this._initialStartDate = drpData.startDate;
			this._initialEndDate = drpData.endDate;
			this._startDate = this._initialStartDate;
			this._endDate = this._initialEndDate;
			
			var self = this;
			 //set Clear event
			 $(this._dateRangePicker).on('cancel.daterangepicker', function(ev, picker) {
				//reset initial dates
				picker.setStartDate(self._initialStartDate);
				picker.setEndDate(self._initialEndDate);
				self._startDate = self._initialStartDate;
				self._endDate = self._initialEndDate;
				
				self._hasSelectedDateRange = false;
				
				//reset attributes
				$(this).val('');
				self._contextObj.set(self.startDateAttribute, "");
				self._contextObj.set(self.endDateAttribute, "");
				if (self.onChangeMicroflow.length > 0) {
                    self._runMicroflow(self._contextObj, self.onChangeMicroflow);
                }
			});
			
			//set onChange event
			$(this._dateRangePicker).on('hide.daterangepicker', function(ev, picker) {
				//determine if selected range has changed
				var hasChanged = picker.startDate._d.getTime() !== self._startDate._d.getTime() || picker.endDate._d.getTime() !== self._endDate._d.getTime();
				if (hasChanged) {
					self._hasSelectedDateRange = true;
					self._startDate = picker.startDate;
					self._endDate = picker.endDate;
					dojoOn.emit(this, "change", {
						bubbles: false,
						cancelable: true
					});
				} else {
					if (!self._hasSelectedDateRange) {
						//undo auto update input field
						$(this).val('');
					}
				}
			});
			
			//Set placeholderText
			var defaultPlaceholderText = '';
			if (this.placeholderText && this.placeholderText.trim().length) {
				defaultPlaceholderText = this.placeholderText;
			} else {
				if (this.useCustomDateFormat && this.customDateFormat.trim().length) {
					defaultPlaceholderText = this.customDateFormat + ' - ' + this.customDateFormat;
				} else {
						defaultPlaceholderText = 'MM/DD/YYYY - MM/DD/YYYY';
				}
			}
			
			$(this._dateRangePicker).attr("placeholder", defaultPlaceholderText);

			// Set label
			if (this.labelCaption && this.labelCaption.trim().length) {
                this.inputLabel.innerHTML = this.labelCaption;
            } else {
                dojoConstruct.destroy(this.inputLabel);
            }

            if (this.displayEnum === "horizontal") {
                domClass.add(this.inputLabel, "col-sm-" + this.labelWidth);
                domClass.add(this.inputWrapper, "col-sm-" + (12 - this.labelWidth));
            } else {
				domClass.add(this.widgetWrapper, 'no-columns');
			}

            this._setupEvents();
        }
// dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
dijit . _WidgetBase . postCreate is called after constructing the widget . Implement to do extra setup work .
function postCreate() {
            logger.debug(this.id + ".postCreate");
            if (this.readOnly || this.get("disabled") || this.readonly) {
                this._readOnly = true;
            }
            this._dateRangePickerButton = $(this.domNode)
                .find("button.mx-dateinput-select-button")
                .first()
                .get(0);
            $(this._dateRangePickerButton).attr("title", this.iconTooltip);
            this._dateRangePicker = $(this.domNode)
                .find("input.mx-dateinput-input")
                .first()
                .get(0);
            this._setParams();
			 $(this._dateRangePicker).daterangepicker(this.params);
			var drpData = $(this._dateRangePicker).data('daterangepicker');
			this._initialStartDate = drpData.startDate;
			this._initialEndDate = drpData.endDate;
			this._startDate = this._initialStartDate;
			this._endDate = this._initialEndDate;
			var self = this;
			 $(this._dateRangePicker).on('cancel.daterangepicker', function(ev, picker) {
				picker.setStartDate(self._initialStartDate);
				picker.setEndDate(self._initialEndDate);
				self._startDate = self._initialStartDate;
				self._endDate = self._initialEndDate;
				self._hasSelectedDateRange = false;
				$(this).val('');
				self._contextObj.set(self.startDateAttribute, "");
				self._contextObj.set(self.endDateAttribute, "");
				if (self.onChangeMicroflow.length > 0) {
                    self._runMicroflow(self._contextObj, self.onChangeMicroflow);
                }
			});
			$(this._dateRangePicker).on('hide.daterangepicker', function(ev, picker) {
				var hasChanged = picker.startDate._d.getTime() !== self._startDate._d.getTime() || picker.endDate._d.getTime() !== self._endDate._d.getTime();
				if (hasChanged) {
					self._hasSelectedDateRange = true;
					self._startDate = picker.startDate;
					self._endDate = picker.endDate;
					dojoOn.emit(this, "change", {
						bubbles: false,
						cancelable: true
					});
				} else {
					if (!self._hasSelectedDateRange) {
						$(this).val('');
					}
				}
			});
			var defaultPlaceholderText = '';
			if (this.placeholderText && this.placeholderText.trim().length) {
				defaultPlaceholderText = this.placeholderText;
			} else {
				if (this.useCustomDateFormat && this.customDateFormat.trim().length) {
					defaultPlaceholderText = this.customDateFormat + ' - ' + this.customDateFormat;
				} else {
						defaultPlaceholderText = 'MM/DD/YYYY - MM/DD/YYYY';
				}
			}
			$(this._dateRangePicker).attr("placeholder", defaultPlaceholderText);
			if (this.labelCaption && this.labelCaption.trim().length) {
                this.inputLabel.innerHTML = this.labelCaption;
            } else {
                dojoConstruct.destroy(this.inputLabel);
            }
            if (this.displayEnum === "horizontal") {
                domClass.add(this.inputLabel, "col-sm-" + this.labelWidth);
                domClass.add(this.inputWrapper, "col-sm-" + (12 - this.labelWidth));
            } else {
				domClass.add(this.widgetWrapper, 'no-columns');
			}
            this._setupEvents();
        }
function postCreate ( ) { logger . debug ( this . id + ".postCreate" ) ; if ( this . readOnly || this . get ( "disabled" ) || this . readonly ) { this . _readOnly = true ; } this . _dateRangePickerButton = $ ( this . domNode ) . find ( "button.mx-dateinput-select-button" ) . first ( ) . get ( 0 ) ; $ ( this . _dateRangePickerButton ) . attr ( "title" , this . iconTooltip ) ; this . _dateRangePicker = $ ( this . domNode ) . find ( "input.mx-dateinput-input" ) . first ( ) . get ( 0 ) ; this . _setParams ( ) ; $ ( this . _dateRangePicker ) . daterangepicker ( this . params ) ; var drpData = $ ( this . _dateRangePicker ) . data ( 'daterangepicker' ) ; this . _initialStartDate = drpData . startDate ; this . _initialEndDate = drpData . endDate ; this . _startDate = this . _initialStartDate ; this . _endDate = this . _initialEndDate ; var self = this ; $ ( this . _dateRangePicker ) . on ( 'cancel.daterangepicker' , function ( ev , picker ) { picker . setStartDate ( self . _initialStartDate ) ; picker . setEndDate ( self . _initialEndDate ) ; self . _startDate = self . _initialStartDate ; self . _endDate = self . _initialEndDate ; self . _hasSelectedDateRange = false ; $ ( this ) . val ( '' ) ; self . _contextObj . set ( self . startDateAttribute , "" ) ; self . _contextObj . set ( self . endDateAttribute , "" ) ; if ( self . onChangeMicroflow . length > 0 ) { self . _runMicroflow ( self . _contextObj , self . onChangeMicroflow ) ; } } ) ; $ ( this . _dateRangePicker ) . on ( 'hide.daterangepicker' , function ( ev , picker ) { var hasChanged = picker . startDate . _d . getTime ( ) !== self . _startDate . _d . getTime ( ) || picker . endDate . _d . getTime ( ) !== self . _endDate . _d . getTime ( ) ; if ( hasChanged ) { self . _hasSelectedDateRange = true ; self . _startDate = picker . startDate ; self . _endDate = picker . endDate ; dojoOn . emit ( this , "change" , { bubbles : false , cancelable : true } ) ; } else { if ( ! self . _hasSelectedDateRange ) { $ ( this ) . val ( '' ) ; } } } ) ; var defaultPlaceholderText = '' ; if ( this . placeholderText && this . placeholderText . trim ( ) . length ) { defaultPlaceholderText = this . placeholderText ; } else { if ( this . useCustomDateFormat && this . customDateFormat . trim ( ) . length ) { defaultPlaceholderText = this . customDateFormat + ' - ' + this . customDateFormat ; } else { defaultPlaceholderText = 'MM/DD/YYYY - MM/DD/YYYY' ; } } $ ( this . _dateRangePicker ) . attr ( "placeholder" , defaultPlaceholderText ) ; if ( this . labelCaption && this . labelCaption . trim ( ) . length ) { this . inputLabel . innerHTML = this . labelCaption ; } else { dojoConstruct . destroy ( this . inputLabel ) ; } if ( this . displayEnum === "horizontal" ) { domClass . add ( this . inputLabel , "col-sm-" + this . labelWidth ) ; domClass . add ( this . inputWrapper , "col-sm-" + ( 12 - this . labelWidth ) ) ; } else { domClass . add ( this . widgetWrapper , 'no-columns' ) ; } this . _setupEvents ( ) ; }
dijit._WidgetBase.postCreate is called after constructing the widget.
dijit . _WidgetBase . postCreate is called after constructing the widget .
//init daterange picker //set initial start and end date, to be used for clearing the calendar //set Clear event //reset initial dates //reset attributes //set onChange event //determine if selected range has changed //undo auto update input field //Set placeholderText // Set label