<?php 
$html='';
        $html.='<div
                class=" input-append input-prepend date dateTimePicker navbar-search"
                id="datetimepicker" 
            >';        
	  $html.='<span class="add-on"><i class="icon-arrow-left" onclick="prevDay()"></i></span>';
	  $html.= CHtml::textField('StatisticDay',date('Y'), array(
            
            'size'=>60,
            'maxlength'=>256,
            'readonly'=>'readonly',
            'disabled' => 'disabled',
            'class'=>'span1'
        ));

        $html.='<span class="add-on"><i class="icon-th"></i></span>';
        $html.='<span class="add-on"><i class="icon-arrow-right" onclick="nextDay()"></i></span>';
        $html.='</div>';

      echo $html;
	
      $dataUrl =  url('analyticsDailyReport/default/createReport',
	array(
	  'id'=>isset($_GET['id']) ? $_GET['id'] : $model ? $model->id :'',
	  'targetType'=>isset($_GET['targetType']) ? $_GET['targetType'] : $model ? $this->getStatisticTypeByClassName(get_class($model)) :'',
	)
      );
?>
<script>
var selectedDayTimestamp = $('#StatisticDay').val();

var dailyOptions = {
  format: 'yyyy',
  autoclose:true,
  startView:4,
  minView:4,
  todayBtn:true,
  forceParse:false,
  pickerPosition:'bottom-left',
  showMeridian:false,
  endDate: new Date()
}

$('.dateTimePicker').datetimepicker(dailyOptions)

$('#StatisticDay').on('change',function(ev) {  
      changeDate();
      updateDiagram();
});
function nextDay() {

  $('.dateTimePicker').datetimepicker('setDate',new Date(new Date($('#StatisticDay').val()).getTime() + (366*24 * 60 * 60 * 1000)));
  $('#StatisticDay').trigger('change');
}
function prevDay() {

  $('.dateTimePicker').datetimepicker('setDate',new Date(new Date($('#StatisticDay').val()).getTime() - (365*24 * 60 * 60 * 1000)));
  $('#StatisticDay').trigger('change');
}
</script>