|
Class TDateFormat
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.
Gets or sets the default text. If Value is not set, DefaultText will be shown
instead of todays date and time.
-
TComponent
-
TApplicationComponent
-
TControl
implements
IRenderable,
IBindable
-
TI18NControl
-
TDateFormat
implements
IDataRenderer
Package: System\ I18N
Copyright:
Copyright © 2005-2014 PradoSoft
License:
http://www.pradosoft.com/license/
Author:
Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
Version:
v1.0, last update on Sat Dec 11 15:25:11 EST 2004
Located at I18N/TDateFormat.php
Methods summary
public
|
#
setPattern( string $value )
Sets the date time formatting pattern.
Sets the date time formatting pattern.
Parameters
- $value
string format pattern.
|
public
string
|
#
getPattern( )
Gets the date time format pattern.
Gets the date time format pattern.
Returns
string format pattern.
|
protected
string
|
#
getPreset( string $string )
For a given string, try and find a preset pattern.
For a given string, try and find a preset pattern.
Parameters
- $string
string the preset pattern name
Returns
string a preset pattern if found, null otherwise.
|
public
string
|
#
getValue( )
Get the date-time value for this control.
Get the date-time value for this control.
Returns
string date time value.
|
public
|
#
setValue( string $value )
Set the date-time value for this control.
Set the date-time value for this control.
Parameters
- $value
string the date-time value.
|
public
string
|
#
getDefaultText( )
Get the default text value for this control.
Get the default text value for this control.
Returns
string default text value
|
public
|
#
setDefaultText( string $value )
Set the default text value for this control.
Set the default text value for this control.
Parameters
- $value
string default text value
|
public
string
|
#
getData( )
Get the date-time value for this control. This method is required by IDataRenderer . It is the same as TDateFormat::getValue() .
Returns
string date time value.
Since
3.1.2
See
Implementation of
|
public
|
#
setData( string $value )
Set the date-time value for this control. This method is required by IDataRenderer . It is the same as TDateFormat::setValue() .
Parameters
- $value
string the date-time value.
Since
3.1.2
See
Implementation of
|
protected
|
#
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.
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.
|
public
|
#
render( THtmlWriter $writer )
Renders the control. This method is invoked by TControl::renderControl() when the
control is visible. You can override this method to provide customized rendering
of the control. By default, the control simply renders all its child
contents.
Renders the control. This method is invoked by TControl::renderControl() when the
control is visible. You can override this method to provide customized rendering
of the control. By default, the control simply renders all its child
contents.
Parameters
- $writer
THtmlWriter
the writer used for the rendering purpose
Overrides
|
Methods inherited from TControl
__construct(),
__get(),
addParsedObject(),
addToPostDataLoader(),
addedControl(),
applyStyleSheetSkin(),
autoBindProperty(),
autoDataBindProperties(),
bindProperty(),
broadcastEvent(),
bubbleEvent(),
clearChildState(),
clearControlState(),
clearNamingContainer(),
clearViewState(),
convertUniqueIdToClientId(),
createChildControls(),
createControlCollection(),
dataBind(),
dataBindChildren(),
dataBindProperties(),
ensureChildControls(),
findControl(),
findControlsByID(),
findControlsByType(),
focus(),
getAdapter(),
getAllowChildControls(),
getAttribute(),
getAttributes(),
getChildControlsCreated(),
getClientID(),
getControlStage(),
getControlState(),
getControls(),
getCustomData(),
getEnableTheming(),
getEnableViewState(),
getEnabled(),
getHasAdapter(),
getHasAttributes(),
getHasChildInitialized(),
getHasControls(),
getHasInitialized(),
getHasLoaded(),
getHasLoadedPostData(),
getHasPreRendered(),
getID(),
getIsSkinApplied(),
getNamingContainer(),
getPage(),
getParent(),
getRegisteredObject(),
getSkinID(),
getSourceTemplateControl(),
getTemplateControl(),
getUniqueID(),
getViewState(),
getVisible(),
hasAttribute(),
initRecursive(),
isDescendentOf(),
isObjectRegistered(),
loadRecursive(),
loadState(),
loadStateRecursive(),
onDataBinding(),
onInit(),
onLoad(),
onPreRender(),
onUnload(),
preRenderRecursive(),
raiseBubbleEvent(),
registerObject(),
removeAttribute(),
removedControl(),
renderChildren(),
renderControl(),
saveState(),
saveStateRecursive(),
setAdapter(),
setAttribute(),
setChildControlsCreated(),
setControlStage(),
setControlState(),
setCustomData(),
setEnableTheming(),
setEnableViewState(),
setEnabled(),
setID(),
setPage(),
setSkinID(),
setTemplateControl(),
setViewState(),
setVisible(),
trackViewState(),
traverseChildControls(),
unbindProperty(),
unloadRecursive(),
unregisterObject()
|
Methods inherited from TComponent
__call(),
__destruct(),
__isset(),
__set(),
__sleep(),
__unset(),
__wakeup(),
asa(),
attachBehavior(),
attachBehaviors(),
attachClassBehavior(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
clearBehaviors(),
createdOnTemplate(),
detachBehavior(),
detachBehaviors(),
detachClassBehavior(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
evaluateStatements(),
fxAttachClassBehavior(),
fxDetachClassBehavior(),
getAutoGlobalListen(),
getBehaviorsEnabled(),
getClassHierarchy(),
getEventHandlers(),
getListeningToGlobalEvents(),
getSubProperty(),
hasEvent(),
hasEventHandler(),
hasProperty(),
isa(),
listen(),
raiseEvent(),
setSubProperty(),
unlisten()
|
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
|
Properties summary
protected static
DateFormat
|
$formatter |
|
#
Default DateFormat, set to the application culture.
Default DateFormat, set to the application culture.
|
|