Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TDateFormat

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 'fulldate', 'longdate', 'mediumdate', 'shortdate', 'fulltime',
'longtime', 'mediumtime', and 'shorttime'. Custom patterns can specified when the Pattern property does not match the predefined patterns.
  • DefaultText, string,
    Gets or sets the default text. If Value is not set, DefaultText will be
shown instead of todays date and time.

Author: Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
Constants Inherited From TControl
AUTOMATIC_ID_PREFIX, CLIENT_ID_SEPARATOR, CS_CHILD_INITIALIZED, CS_CONSTRUCTED, CS_INITIALIZED, CS_LOADED, CS_PRERENDERED, CS_STATE_LOADED, ID_FORMAT, ID_SEPARATOR, IS_CHILD_CREATED, IS_CREATING_CHILD, IS_DISABLE_THEMING, IS_DISABLE_VIEWSTATE, IS_ID_SET, IS_SKIN_APPLIED, IS_STYLESHEET_APPLIED, RF_ADAPTER, RF_AUTO_BINDINGS, RF_CHILD_STATE, RF_CONTROLS, RF_CONTROLSTATE, RF_DATA_BINDINGS, RF_EVENTS, RF_NAMED_CONTROLS, RF_NAMED_CONTROLS_ID, RF_NAMED_OBJECTS, RF_SKIN_ID,

Method Summary
string
getData ()
Get the date-time value for this control.
string
Get the default text value for this control.
protected  void
Renders the localized version of the date-time value.
string
Gets the date time format pattern.
protected  string
getPreset ( string $string)
For a given string, try and find a preset pattern.
string
Get the date-time value for this control.
void
render ( mixed $writer)
void
setData ( string $value)
Set the date-time value for this control.
void
setDefaultText ( string $value)
Set the default text value for this control.
void
setPattern ( string $value)
Sets the date time formatting pattern.
void
setValue ( string $value)
Set the date-time value for this control.
Methods Inherited From TI18NControl
TI18NControl::getCharset(), TI18NControl::getCulture(), TI18NControl::setCharset(), TI18NControl::setCulture()
Methods Inherited From TControl
TControl::addedControl(), TControl::addParsedObject(), TControl::addToPostDataLoader(), TControl::applyStyleSheetSkin(), TControl::autoBindProperty(), TControl::autoDataBindProperties(), TControl::bindProperty(), TControl::broadcastEvent(), TControl::bubbleEvent(), TControl::clearChildState(), TControl::clearControlState(), TControl::clearNamingContainer(), TControl::clearViewState(), TControl::convertUniqueIdToClientId(), TControl::createChildControls(), TControl::createControlCollection(), 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::getCustomData(), TControl::getEnabled(), TControl::getEnableTheming(), TControl::getEnableViewState(), TControl::getHasAdapter(), TControl::getHasAttributes(), TControl::getHasChildInitialized(), TControl::getHasControls(), TControl::getHasInitialized(), TControl::getHasLoaded(), TControl::getHasLoadedPostData(), TControl::getHasPreRendered(), 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::setCustomData(), TControl::setEnabled(), TControl::setEnableTheming(), TControl::setEnableViewState(), TControl::setID(), TControl::setPage(), TControl::setSkinID(), TControl::setTemplateControl(), TControl::setViewState(), TControl::setVisible(), TControl::trackViewState(), TControl::traverseChildControls(), TControl::unbindProperty(), TControl::unloadRecursive(), TControl::unregisterObject(), TControl::__get()
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods Inherited From TComponent
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constant Summary

Method Details

getData

public string getData ()

Get the date-time value for this control.

This method is required by IDataRenderer. It is the same as getValue().

Output
string date time value.
Exception

getDefaultText

public string getDefaultText ()

Get the default text value for this control.

Output
string default text value
Exception

getFormattedDate

protected void getFormattedDate ()

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.

Output
Exception

getPattern

public string getPattern ()

Gets the date time format pattern.

Output
string format pattern.
Exception

getPreset

protected string getPreset (string $string )

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

Input
string$stringthe preset pattern name
Output
string a preset pattern if found, null otherwise.
Exception

getValue

public string getValue ()

Get the date-time value for this control.

Output
string date time value.
Exception

render

public void render (mixed $writer )

Input
mixed$writer
Output
Exception

setData

public void setData (string $value )

Set the date-time value for this control.

This method is required by IDataRenderer. It is the same as setValue().

Input
string$valuethe date-time value.
Output
Exception

setDefaultText

public void setDefaultText (string $value )

Set the default text value for this control.

Input
string$valuedefault text value
Output
Exception

setPattern

public void setPattern (string $value )

Sets the date time formatting pattern.

Input
string$valueformat pattern.
Output
Exception

setValue

public void setValue (string $value )

Set the date-time value for this control.

Input
string$valuethe date-time value.
Output
Exception