timeformat = $timeformat; } function dataValue() { if($this->value) { return date($this->timeformat,strtotime($this->value)); } else { return $this->value; } } function setValue($val) { if($val) { $this->value = date($this->timeformat,strtotime($val)); } else { $this->value = $val; } } /** * Creates a new readonly field specified below */ function performReadonlyTransformation() { return new TimeField_Readonly( $this->name, $this->title, $this->dataValue(),$this->timeformat); } } /** * The readonly class for our {@link TimeField}. * @package forms * @subpackage fields-datetime */ class TimeField_Readonly extends TimeField { protected $readonly = true; function Field() { if( $this->value ) $val = $this->attrValue(); else $val = '(not set)'; return "id() . "\">$val"; } }