summaryrefslogtreecommitdiff
path: root/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php')
-rw-r--r--protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php b/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php
index 3a73cb6..8d5bdf4 100644
--- a/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php
+++ b/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php
@@ -3,6 +3,7 @@
* CJuiDateTimePicker class file.
*
* @author Anatoly Ivanchin <van4in@gmail.com>
+ * @author Tristan Zur
*/
Yii::import('zii.widgets.jui.CJuiDatePicker');
@@ -11,6 +12,7 @@ class CJuiDateTimePicker extends CJuiDatePicker
const ASSETS_NAME='/jquery-ui-timepicker-addon';
public $mode='datetime';
+ public $phpDateFormat = 'dd.MM.yyyy HH:mm';
public function init()
{
@@ -34,9 +36,11 @@ class CJuiDateTimePicker extends CJuiDatePicker
else
$this->htmlOptions['name']=$name;
- if($this->hasModel())
- echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);
- else
+ if($this->hasModel()) {
+ // Add support for model attribute and date time formatting
+ $this->value = CHtml::resolveValue($this->model, $this->attribute);
+ $this->value = Format::displayDateTime($this->value);
+ }
echo CHtml::textField($name,$this->value,$this->htmlOptions);