<?php 

$attributeName =$column->name;

$name = 'DateTimeRule['.$data->type.']['.$row.']['.$data->id.']['.$attributeName.']';
$formatedTime = null;
if ($data->$attributeName != '') {
    $formatedTime = date(PhonalisaDate::userTimePattern(), strtotime($data->$attributeName));
}

// Time picker Doc. : http://jdewit.github.com/bootstrap-timepicker/
echo '<div class="timepickerContent">';
    echo '<div class="input-append bootstrap-timepicker">';
        echo CHtml::textField(
            $name,
            $formatedTime,
            array(
                'onclick'=>'toggleTimePicker(this)',
                'class'=>'contextHelp-span1 timepickerInput',
                'placeholder'=>'∞',
                "data-custom-contexthelp-key" => "DATETIMERULE_". strtoupper($attributeName). "_CUSTOM_CONTEXT_HELP" ,
            ));
        echo '<span class="add-on"><i class="icon-time"></i></span>';
    echo '</div>';
        echo '<div class="input-append">';
        echo '<span class="add-on" onclick="clearParentInput(this)"><i class="icon-remove"></i></span>';
    echo '</div>';
echo '</div>';
if ($column->name == 'time_to') {
    $name = 'DateTimeRule['.$data->type.']['.$row.']['.$data->id.'][sort]';
    $value = $row;
    $htmlOptions=array('class'=>'hiddenSort');
    echo CHtml::hiddenField($name,$value,$htmlOptions);
}