## Class TDateFormat

Description

To format dates and/or time according to the current locale use

     <com:TDateFormat Pattern="dd:MMM:yyyy" Value="01/01/2001" />

The date will be formatted according to the current locale (or culture) using the format specified by 'Pattern' attribute.

To format date and/or time for a locale (e.g. de_DE) include a Culture attribute, for example:

     <com:TDateFormat Culture="de_DE" Value="01/01/2001 12:00" />

The date will be formatted according to this format.

If no Pattern was specified then the date will be formatted with the default format (both date and time). If no value for the date is specified then the current date will be used. E.g.:

    <com:TDateFormat />

will result in the current date, formatted with default localized pattern.

Namespace: System.I18N

Properties

- Value, date,
  Gets or sets the date to format. The tag content is used as Value if the Value property is not specified.
- Pattern, string,
  Gets or sets the formatting pattern. The predefined patterns are 'fulldate', 'longdate', 'mediumdate', 'shortdate', 'fulltime',

'longtime', 'mediumtime', and 'shorttime'. Custom patterns can specified when the Pattern property does not match the predefined patterns.

- version: v1.0, last update on Sat Dec 11 15:25:11 EST 2004
- author: Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /I18N/TDateFormat.php (line 59)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TI18NControl
                |
                --TDateFormat

Variable Summary
DateFormat $formatter
Method Summary
void getFormattedDate ()
string getPattern ()
string getPreset (string $string)
string getValue ()
void render (mixed $writer)
void setPattern (string $value)
void setValue (string $value)
Variables
DateFormat $formatter (line 65)

Default DateFormat, set to the application culture.

- static:
- access: protected

Methods
getFormattedDate (line 168)

Renders the localized version of the date-time value.

If the culture is not specified, the default application culture will be used. This method overrides parent's implementation.

- access: protected

void getFormattedDate ()
getPattern (line 92)

Gets the date time format pattern.

- return: format pattern.
- access: public

string getPattern ()
getPreset (line 131)

For a given string, try and find a preset pattern.

- return: a preset pattern if found, null otherwise.
- access: protected

string getPreset (string $string)

- string $string: the preset pattern name

getValue (line 145)

Get the date-time value for this control.

- return: date time value.
- access: public

string getValue ()
render (line 193)

- access: public

void render (mixed $writer)

Redefinition of:

TControl::render()
  Renders the control.

setPattern (line 83)

Sets the date time formatting pattern.

- access: public

void setPattern (string $value)

- string $value: format pattern.

setValue (line 157)

Set the date-time value for this control.

- access: public

void setValue (string $value)

- string $value: the date-time value.

#### Inherited Methods

Inherited From TI18NControl

> TI18NControl::getCharset()
> TI18NControl::getCulture()
> TI18NControl::setCharset()
> TI18NControl::setCulture()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TControl

Documentation generated on Sun, 04 Jun 2006 18:59:15 -0400 by phpDocumentor 1.3.0RC4