System.I18N
[ class tree: System.I18N ] [ index: System.I18N ] [ all elements ]

Class: TDateFormat

Source Location: /I18N/TDateFormat.php

Class Overview

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

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

Class Details

[line 62]
To format dates and/or time according to the current locale use

  1. <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:

  1. <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.:

  1. <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 'full date', 'long date', 'medium date', 'short date', 'full time', 'long time', 'medium time', and 'short time'. 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>


[ Top ]

Variables

Methods


Inherited Variables

Inherited Methods

Class: TI18NControl

TI18NControl::charset()
Gets the charset, with fall back to the application charset,
TI18NControl::getCharset()
TI18NControl::getCulture()
Get the specific culture for this control.
TI18NControl::setCharset()
Sets the charset for message output
TI18NControl::setCulture()
Get the custom culture identifier.

Class: TControl

TControl::__construct()
Constructor.
TControl::addBody()
Appends an object into the body collection of this control.
TControl::addParsedObject()
Adds the object parsed in template as a body of the component.
TControl::allowBody()
Determines whether the control can add the object as a body.
TControl::clearViewState()
Clears viewstate
TControl::findBodyControl()
TControl::getAttribute()
TControl::getAttributes()
Returns the attribute list object.
TControl::getAttributesToRender()
Returns attributes to be rendered.
TControl::getBodies()
TControl::getClientID()
Returns the client ID of the component.
TControl::getContainer()
Returns the container of this component.
TControl::getSkinName()
TControl::getTagName()
TControl::getViewState()
Returns a viewstate value.
TControl::initSkin()
Initializes a skin for the control. If a skin name is provided then that skin will be loaded.
TControl::isViewStateEnabled()
TControl::isVisible()
This method checks whether a control is visible.
TControl::loadViewState()
Loads viewstate into this component and its children.
TControl::onBubbleEvent()
This method responds to a bubbled event.
TControl::onInit()
This method is invoked when the control enters 'Init' stage.
TControl::onInitRecursive()
Calls onInit of this control and its children recursively.
TControl::onLoad()
This method is invoked when the control enters 'Load' stage.
TControl::onLoadRecursive()
Calls onLoad of this control and its children recursively.
TControl::onPreRender()
This method is invoked when the control enters 'PreRender' stage.
TControl::onPreRenderRecursive()
Calls onPreRender of this control and its children recursively.
TControl::onUnload()
This method is invoked when the control enters 'Unload' stage.
TControl::onUnloadRecursive()
Calls onUnload of this control and its children recursively.
TControl::raiseBubbleEvent()
Invokes the parent's onBubbleEvent method.
TControl::removeBodies()
Removes all body content.
TControl::render()
Renders this control.
TControl::renderAttributes()
Renders the attributes.
TControl::renderBody()
Renders the body content.
TControl::saveViewState()
Returns the viewstate of this component and its children.
TControl::setAttribute()
Sets an attribute.
TControl::setContainer()
Sets the container of this component
TControl::setEnableViewState()
TControl::setSkinName()
Sets the skin to use for this control
TControl::setTagName()
Sets the tag name.
TControl::setViewState()
Sets a viewstate value.
TControl::setVisible()
TControl::synchronizeControl()
This method should only be used by framework developer.

Class: TComponent

TComponent::__construct()
Constructor.
TComponent::addChild()
Adds a child component.
TComponent::addParsedObject()
Handles a component or string met in template.
TComponent::attachEventHandler()
Attaches a handler function to an event.
TComponent::bindProperty()
Sets up the binding between a property and an expression.
TComponent::canGetProperty()
Determines whether a property can be read.
TComponent::canSetProperty()
Determines whether a property can be written.
TComponent::createComponent()
Creates a child component.
TComponent::dataBind()
Performs the databinding for this component.
TComponent::evaluateExpression()
Evaluates a PHP expression.
TComponent::evaluateStatements()
Evaluates a list of PHP statements.
TComponent::findObject()
Finds an object by its ID path.
TComponent::getApplication()
TComponent::getChild()
TComponent::getChildren()
TComponent::getDefinition()
Returns or builds a component definition.
TComponent::getGlobalization()
Returns the Globalization instance for the application.
TComponent::getID()
TComponent::getModule()
Returns the module object that contains the component or the page containing the component.
TComponent::getPage()
TComponent::getParent()
TComponent::getPropertyInitValue()
Gets the initial value of a property.
TComponent::getPropertyType()
Returns the type of a property
TComponent::getRequest()
Returns the request object associated with application.
TComponent::getServiceManager()
Returns the service manager for this application.
TComponent::getSession()
Returns the session object associated with the application.
TComponent::getSessionState()
Returns a session variable.
TComponent::getUniqueID()
Returns the unique ID of the component.
TComponent::getUser()
Returns the user object associated with the application.
TComponent::hasChildren()
TComponent::hasEvent()
Determines whether an event is defined.
TComponent::hasProperty()
Determines whether a property is defined.
TComponent::initProperties()
Initializes the property values.
TComponent::instantiateTemplate()
Parses a template string and instantiates the content.
TComponent::onDataBinding()
This method is invoked when dataBind is invoked for the component.
TComponent::raiseEvent()
Invokes all attached event handler functions for a particular event.
TComponent::removeChild()
Removes a child component.
TComponent::removeChildren()
Removes all child components.
TComponent::setAttribute()
Sets an attribute.
TComponent::setDefinition()
Sets a component definition.
TComponent::setID()
Sets a component ID.
TComponent::setParent()
Sets the parent of this component.
TComponent::setPropertyInitValue()
Sets the initial value of a property.
TComponent::setRoot()
Sets the root component in the component hierarchy.
TComponent::setSessionState()
Sets a session variable.
TComponent::unbindProperty()
Breaks the binding between a property and an expression.
TComponent::__get()
Returns a property value by name or a child component by ID.
TComponent::__set()
Sets value of a component property.

Class Variables

$formatter =

[line 68]

Default DateFormat, set to the application culture.



static:  
access:  protected

Type:   DateFormat


[ Top ]

$patternPresets = array(
         'fulldate'=>'P','full'=>'P',
         'longdate'=>'D','long'=>'d',
         'mediumdate'=>'p','medium'=>'p',
         'shortdate'=>'d','short'=>'d',
         'fulltime'=>'Q', 'longtime'=>'T',
         'mediumtime'=>'q', 'shorttime'=>'t')

[line 74]

A set of pattern presets and their respective formatting shorthand.



access:  protected

Type:   array


[ Top ]



Class Methods


method getPattern [line 95]

string getPattern( )

Gets the date time format pattern.



return:  format pattern.


[ Top ]

method getPreset [line 134]

string getPreset( string $string)

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



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


Parameters:

string   $string   the preset pattern name

[ Top ]

method getValue [line 148]

string getValue( )

Get the date-time value for this control.



return:  date time value.


[ Top ]

method renderBody [line 177]

void renderBody( )

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


Overrides TControl::renderBody() (Renders the body content.)

[ Top ]

method setPattern [line 86]

void setPattern( string $value)

Sets the date time formatting pattern.



Parameters:

string   $value   format pattern.

[ Top ]

method setValue [line 166]

void setValue( string $value)

Set the date-time value for this control.



Parameters:

string   $value   the date-time value.

[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.