Class \Prado\I18N\TDateFormat
<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. The 'Pattern' attribute can also contain two of the predefined presets, the first one for the date part and the second for the time part: 'full', 'long', 'medium', 'short', 'none'. If only one preset is present, it will be used for both the date and the time parts.
<com:TDateFormat Pattern="medium long" Value="01/01/2001 15:30:45" />
<com:TDateFormat Pattern="full" Value="01/01/2001 15:30:45" />
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.
Class hierarchy
- \Prado\I18N\TDateFormat implements IDataRenderer
- \Prado\I18N\TI18NControl
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Author: Fabio Bas <ctrlaltca[at]gmail[dot]com>
public
|
getData() : string
Get the date-time value for this control.
This method is required by IDataRenderer. It is the same as getValue(). |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
setData(string $value) : mixed
Set the date-time value for this control.
This method is required by IDataRenderer. It is the same as setValue(). |
public
|
|
public
|
|
public
|
|
protected
|
getFormattedDate() : mixed
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. |
protected
|
getFormatter(string $culture, mixed $datetype, mixed $timetype) : NumberFormatter
Formats the localized number, be it currency or decimal, or percentage.
If the culture is not specified, the default application culture will be used. |
protected
|