<?php
 class dateField extends baseField { var $Conf = array( 'xtype' => 'datefield', 'editable' => false, 'anchor' => 'auto', 'icon' => 'time.png', ); function edit($addConf,$R) { $R['format'] = 'd.m.Y'; if(!$R['value'] AND $addConf['attr']['defaultValueToday']) { $R['value'] = mktime(); } if($R['value']) { $R['value'] = date($R['format'],$R['value']); } return parent::edit($addConf,$R); } function getSetValue($v) { if($v) { $tmp = explode('.',$v); $v = mktime(0,1,0,$tmp[1],$tmp[0],$tmp[2]); } return $v; } function getGetValue($v) { if(!$v) return ''; return date('d.m.Y',$v); } } ?>