DateTimePicker.php
protected function renderWidgetDateRange()
    {
    	$contents = [];
    	$content2s = [];
    
    	$value = $this->value;
    	$valueTo= $this->valueTo;
    	
    	//send value to hasModel() in InputWidget
    	$this->attribute = $this->from;
    	
    	// get formatted date value
    	if ( ($value == null || $value == '' )  && $this->hasModel() ) {
    		$value = Html::getAttributeValue($this->model, $this->from);
    	}
    	
    	
    	if ( ($valueTo == null || $valueTo == '' )  && $this->hasModel() ) {
    		$valueTo = Html::getAttributeValue($this->model, $this->to);
    	}
    
    	if ($value !== null && $value !== '') {
    		// format value according to dateFormat
    		try {
    			$value = Yii::$app->formatter->asDate($value, $this->dateFormat);
    		} catch(InvalidParamException $e) {
    			// ignore exception and keep original value if it is not a valid date
    		}
    	}
    	
    	if ($valueTo !== null && $valueTo !== '') {
    		// format value according to dateFormat
    		try {
    			$valueTo = Yii::$app->formatter->asDate($valueTo, $this->dateFormat);
    		} catch(InvalidParamException $e) {
    			// ignore exception and keep original value if it is not a valid date
    		}
    	}
    	
    	$options = $this->options;
    	$options['value'] = $value;
    
    	if ($this->inline === false) {  
    		// render a text input
    		if ($this->hasModel()) {
    			$options['id'] = $this->from;
    			$contents[] = Html::activeTextInput($this->model, $this->from, $options);
    			
    			$options['id'] = $this->to;
    			$options['value'] = $valueTo;
    			$content2s[] = Html::activeTextInput($this->model, $this->to, $options);
    		} else {
    			$options['id'] = $this->from;
    			$contents[] = Html::textInput($this->from, $value, $options);
    			
    			$options['value'] = $valueTo;
    			$options['id'] = $this->to;
    			$content2s[] = Html::textInput($this->to, $valueTo, $options);
    		}
    	} else { 
    		// render an inline date picker with hidden input
    		if ($this->hasModel()) {
    			$contents[] = Html::activeHiddenInput($this->model, $this->from, $options);
    			$options['value'] = $valueTo;
    			$content2s[] = Html::activeHiddenInput($this->model, $this->to, $options);
    		} else {
    			$contents[] = Html::hiddenInput($this->from, $value, $options);
    			$options['value'] = $valueTo;
    			$content2s[] = Html::hiddenInput($this->to, $valueTo, $options);
    		}
    		$this->clientOptions['defaultDate'] = $value;
    		$this->clientOptions['altField'] = '#' . $this->from;
    		$contents[] = Html::tag('div', null, $this->containerOptions);
    		
    		$this->clientOptions['defaultDate'] = $valueTo;
    		$this->clientOptions['altField'] = '#' . $this->to;
    		$content2s[] = Html::tag('div', null, $this->containerOptions);
    	}
    
    	return '<div class="inline"><div class="input-group">'.
    	implode("\n", $contents).
    	'<div class="input-group-addon"> '.$this->separate.' </div>'.
    	implode("\n", $content2s).
    	'</div></div>';
    }
protected function renderWidgetDateRange()
    {
    	$contents = [];
    	$content2s = [];
    
    	$value = $this->value;
    	$valueTo= $this->valueTo;
    	
    	//send value to hasModel() in InputWidget
    	$this->attribute = $this->from;
    	
    	// get formatted date value
    	if ( ($value == null || $value == '' )  && $this->hasModel() ) {
    		$value = Html::getAttributeValue($this->model, $this->from);
    	}
    	
    	
    	if ( ($valueTo == null || $valueTo == '' )  && $this->hasModel() ) {
    		$valueTo = Html::getAttributeValue($this->model, $this->to);
    	}
    
    	if ($value !== null && $value !== '') {
    		// format value according to dateFormat
    		try {
    			$value = Yii::$app->formatter->asDate($value, $this->dateFormat);
    		} catch(InvalidParamException $e) {
    			// ignore exception and keep original value if it is not a valid date
    		}
    	}
    	
    	if ($valueTo !== null && $valueTo !== '') {
    		// format value according to dateFormat
    		try {
    			$valueTo = Yii::$app->formatter->asDate($valueTo, $this->dateFormat);
    		} catch(InvalidParamException $e) {
    			// ignore exception and keep original value if it is not a valid date
    		}
    	}
    	
    	$options = $this->options;
    	$options['value'] = $value;
    
    	if ($this->inline === false) {  
    		// render a text input
    		if ($this->hasModel()) {
    			$options['id'] = $this->from;
    			$contents[] = Html::activeTextInput($this->model, $this->from, $options);
    			
    			$options['id'] = $this->to;
    			$options['value'] = $valueTo;
    			$content2s[] = Html::activeTextInput($this->model, $this->to, $options);
    		} else {
    			$options['id'] = $this->from;
    			$contents[] = Html::textInput($this->from, $value, $options);
    			
    			$options['value'] = $valueTo;
    			$options['id'] = $this->to;
    			$content2s[] = Html::textInput($this->to, $valueTo, $options);
    		}
    	} else { 
    		// render an inline date picker with hidden input
    		if ($this->hasModel()) {
    			$contents[] = Html::activeHiddenInput($this->model, $this->from, $options);
    			$options['value'] = $valueTo;
    			$content2s[] = Html::activeHiddenInput($this->model, $this->to, $options);
    		} else {
    			$contents[] = Html::hiddenInput($this->from, $value, $options);
    			$options['value'] = $valueTo;
    			$content2s[] = Html::hiddenInput($this->to, $valueTo, $options);
    		}
    		$this->clientOptions['defaultDate'] = $value;
    		$this->clientOptions['altField'] = '#' . $this->from;
    		$contents[] = Html::tag('div', null, $this->containerOptions);
    		
    		$this->clientOptions['defaultDate'] = $valueTo;
    		$this->clientOptions['altField'] = '#' . $this->to;
    		$content2s[] = Html::tag('div', null, $this->containerOptions);
    	}
    
    	return '<div class="inline"><div class="input-group">'.
    	implode("\n", $contents).
    	'<div class="input-group-addon"> '.$this->separate.' </div>'.
    	implode("\n", $content2s).
    	'</div></div>';
    }
Renders the DatePicker widget in DateRange Mode.
@return string the rendering result.