* @package tao */ class tao_helpers_form_elements_xhtml_Calendar extends tao_helpers_form_elements_Calendar { use XhtmlRenderingTrait; /** * Rendering of the XHTML implementation of the Calendar Widget. * * @author Bertrand Chevrier, * @return The XHTML stream of the Calendar Widget. */ public function render() { $returnValue = $this->renderLabel(); $uniqueId = uniqid('calendar_'); $elementId = tao_helpers_Display::TextCleaner($this->getDescription()) . '_' . $uniqueId; if (! isset($this->attributes['size'])) { $this->attributes['size'] = 20; } $returnValue .= "
renderAttributes(); if (! empty($this->value)) { $timeStamp = is_numeric($this->getRawValue()) ? $this->getRawValue() : $this->getEvaluatedValue(); $returnValue .= ' value="' . _dh(tao_helpers_Date::displayeDate($timeStamp, tao_helpers_Date::FORMAT_DATEPICKER)) . '"'; } $returnValue .= ' />
'; return (string) $returnValue; } public function getEvaluatedValue() { $returnValue = $this->getRawValue(); if (! empty($returnValue)) { $tz = new DateTimeZone(common_session_SessionManager::getSession()->getTimeZone()); $dt = new DateTime($returnValue, $tz); $returnValue = $dt->getTimestamp() . ''; } return $returnValue; } }