<?php
 class dateField extends baseField { var $Conf = array( 'xtype' => 'datefield', 'editable' => true, 'anchor' => 'auto', 'icon' => 'clock', ); function edit($addConf,$R) { $R['format'] = 'd.m.Y'; if(!$R['value'] AND $addConf['attr']['defaultValueToday']) { $R['value'] = time(); } if($addConf['attr']['forceNow']) { $R['value'] = time(); } 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); } } ?>