[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/i18n/ -> sfDateTimeFormatInfo.class.php (sommaire)

sfDateTimeFormatInfo class file. This program is free software; you can redistribute it and/or modify it under the terms of the BSD License.

Author: Wei Zhuo
Version: $Id: sfDateTimeFormatInfo.class.php 2834 2006-11-27 14:09:05Z fabien $
Poids: 548 lignes (15 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

sfDateTimeFormatInfo:: (35 méthodes):
  __get()
  __set()
  __construct()
  getData()
  getInvariantInfo()
  getInstance()
  getAbbreviatedDayNames()
  setAbbreviatedDayNames()
  getNarrowDayNames()
  setNarrowDayNames()
  getDayNames()
  setDayNames()
  getNarrowMonthNames()
  setNarrowMonthNames()
  getAbbreviatedMonthNames()
  setAbbreviatedMonthNames()
  getMonthNames()
  setMonthNames()
  getEra()
  getAMDesignator()
  setAMDesignator()
  getPMDesignator()
  setPMDesignator()
  getAMPMMarkers()
  setAMPMMarkers()
  getFullTimePattern()
  getLongTimePattern()
  getMediumTimePattern()
  getShortTimePattern()
  getFullDatePattern()
  getLongDatePattern()
  getMediumDatePattern()
  getShortDatePattern()
  getDateTimeOrderPattern()
  formatDateTime()


Classe: sfDateTimeFormatInfo  - X-Ref

Defines how DateTime values are formatted and displayed, depending
on the culture.

This class contains information, such as date patterns, time patterns,
and AM/PM designators.

To create a sfDateTimeFormatInfo for a specific culture, create a
sfCultureInfo for that culture and retrieve the sfCultureInfo.sfDateTimeFormat
property. For example:
<code>
$culture = new sfCultureInfo('en_AU');
$dtfi = $culture->DateTimeFormat;
</code>

To create a sfDateTimeFormatInfo for the invariant culture, use
<code>
sfDateTimeFormatInfo::getInstance($culture=null);
</code>
you may pass a sfCultureInfo parameter $culture to get the sfDateTimeFormatInfo
for a specific culture.

sfDateTime values are formatted using standard or custom patterns stored in
the properties of a sfDateTimeFormatInfo.

The standard patterns can be replaced with custom patterns by setting the
associated properties of sfDateTimeFormatInfo.

The following table lists the standard format characters for each standard
pattern and the associated sfDateTimeFormatInfo property that can be set to
modify the standard pattern. The format characters are case-sensitive;
for example, 'g' and 'G' represent slightly different patterns.

<code>
Format Character    Associated Property     Example Format Pattern (en-US)
--------------------------------------------------------------------------
d                   ShortDatePattern        MM/dd/yyyy
D                   LongDatePattern         dddd, dd MMMM yyyy
F                   FullDateTimePattern     dddd, dd MMMM yyyy HH:mm:ss
m, M                MonthDayPattern         MMMM dd
r, R                RFC1123Pattern          ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
s                   SortableDateTimePattern yyyy'-'MM'-'dd'T'HH':'mm':'ss
t                   ShortTimePattern        HH:mm
T                   LongTimePattern         HH:mm:ss
Y                   YearMonthPattern        yyyy MMMM
--------------------------------------------------------------------------
</code>

__get($name)   X-Ref
Allow functions that begins with 'set' to be called directly
as an attribute/property to retrieve the value.

return: mixed

__set($name, $value)   X-Ref
Allow functions that begins with 'set' to be called directly
as an attribute/property to set the value.


__construct($data=array()   X-Ref
Initializes a new writable instance of the sfDateTimeFormatInfo class
that is dependent on the ICU data for date time formatting
information. <b>N.B.</b>You should not initialize this class directly
unless you know what you are doing. Please use use
sfDateTimeFormatInfo::getInstance() to create an instance.

param: array ICU data for date time formatting.

getData()   X-Ref
Get the internal ICU data for date time formatting.

return: array ICU date time formatting data.

getInvariantInfo()   X-Ref
Gets the default sfDateTimeFormatInfo that is culture-independent (invariant).

return: sfDateTimeFormatInfo default sfDateTimeFormatInfo.

getInstance($culture = null)   X-Ref
Returns the sfDateTimeFormatInfo associated with the specified culture.

param: sfCultureInfo the culture that gets the sfDateTimeFormat property.
return: sfDateTimeFormatInfo sfDateTimeFormatInfo for the specified

getAbbreviatedDayNames()   X-Ref
A one-dimensional array of type String containing
the culture-specific abbreviated names of the days
of the week. The array for InvariantInfo contains
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", and "Sat".

return: array abbreviated day names

setAbbreviatedDayNames($value)   X-Ref
Set the abbreviated day names. The value should be
an array of string starting with Sunday and ends in Saturady.
For example,
<code>array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");</code>

param: array abbreviated day names.

getNarrowDayNames()   X-Ref
A one-dimensional array of type String containing
the culture-specific narrow names of the days
of the week. The array for InvariantInfo contains
"S", "M", "T", "W", "T", "F", and "S".

return: array narrow day names

setNarrowDayNames($value)   X-Ref
Set the narrow day names. The value should be
an array of string starting with Sunday and ends in Saturady.
For example,
<code>array("S", "M", "T", "W", "T", "F", "S");</code>

param: array narrow day names.

getDayNames()   X-Ref
A one-dimensional array of type String containing the
culture-specific full names of the days of the week.
The array for InvariantInfo contains "Sunday", "Monday",
"Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday".

return: array day names

setDayNames($value)   X-Ref
Set the day names. The value should be
an array of string starting with Sunday and ends in Saturady.
For example,
<code>array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday".);</code>

param: array day names.

getNarrowMonthNames()   X-Ref
A one-dimensional array of type String containing the
culture-specific narrow names of the months. The array
for InvariantInfo contains "J", "F", "M", "A", "M", "J",
"J", "A", "S", "O", "N", and "D".

return: array narrow month names.

setNarrowMonthNames($value)   X-Ref
Set the narrow month names. The value should be
an array of string starting with J and ends in D.
For example,
<code>array("J","F","M","A","M","J","J","A","S","O","N","D");</code>

param: array month names.

getAbbreviatedMonthNames()   X-Ref
A one-dimensional array of type String containing the
culture-specific abbreviated names of the months. The array
for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May",
"Jun", "Jul", "Aug", "Sep", "Oct", "Nov", and "Dec".

return: array abbreviated month names.

setAbbreviatedMonthNames($value)   X-Ref
Set the abbreviated month names. The value should be
an array of string starting with Jan and ends in Dec.
For example,
<code>array("Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep","Oct","Nov","Dec");</code>

param: array month names.

getMonthNames()   X-Ref
A one-dimensional array of type String containing the
culture-specific full names of the months. The array for
InvariantInfo contains "January", "February", "March", "April",
"May", "June", "July", "August", "September", "October", "November",
and "December"

return: array month names.

setMonthNames($value)   X-Ref
Set the month names. The value should be
an array of string starting with Janurary and ends in December.
For example,
<code>array("January", "February", "March", "April", "May", "June",
"July", "August", "September","October","November","December");</code>

param: array month names.

getEra($era)   X-Ref
A string containing the name of the era.

param: int era The integer representing the era.
return: string the era name.

getAMDesignator()   X-Ref
The string designator for hours that are "ante meridiem" (before noon).
The default for InvariantInfo is "AM".

return: string AM designator.

setAMDesignator($value)   X-Ref
Set the AM Designator. For example, 'AM'.

param: string AM designator.

getPMDesignator()   X-Ref
The string designator for hours that are "post meridiem" (after noon).
The default for InvariantInfo is "PM".

return: string PM designator.

setPMDesignator($value)   X-Ref
Set the PM Designator. For example, 'PM'.

param: string PM designator.

getAMPMMarkers()   X-Ref
Get the AM and PM markers array.
Default InvariantInfo for AM and PM is <code>array('AM','PM');</code>

return: array AM and PM markers

setAMPMMarkers($value)   X-Ref
Set the AM and PM markers array.
For example <code>array('AM','PM');</code>

param: array AM and PM markers

getFullTimePattern()   X-Ref
Returns the full time pattern "HH:mm:ss z" (default).
This is culture sensitive.

return: string pattern "HH:mm:ss z".

getLongTimePattern()   X-Ref
Returns the long time pattern "HH:mm:ss z" (default).
This is culture sensitive.

return: string pattern "HH:mm:ss z".

getMediumTimePattern()   X-Ref
Returns the medium time pattern "HH:mm:ss" (default).
This is culture sensitive.

return: string pattern "HH:mm:ss".

getShortTimePattern()   X-Ref
Returns the short time pattern "HH:mm" (default).
This is culture sensitive.

return: string pattern "HH:mm".

getFullDatePattern()   X-Ref
Returns the full date pattern "EEEE, yyyy MMMM dd" (default).
This is culture sensitive.

return: string pattern "EEEE, yyyy MMMM dd".

getLongDatePattern()   X-Ref
Returns the long date pattern "yyyy MMMM d" (default).
This is culture sensitive.

return: string pattern "yyyy MMMM d".

getMediumDatePattern()   X-Ref
Returns the medium date pattern "yyyy MMMM d" (default).
This is culture sensitive.

return: string pattern "yyyy MMM d".

getShortDatePattern()   X-Ref
Returns the short date pattern "yy/MM/dd" (default).
This is culture sensitive.

return: string pattern "yy/MM/dd".

getDateTimeOrderPattern()   X-Ref
Returns the date time order pattern, "{1} {0}" (default).
This is culture sensitive.

return: string pattern "{1} {0}".

formatDateTime($date, $time)   X-Ref
Formats the date and time in a culture sensitive paterrn.
The default is "Date Time".

return: string date and time formated



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7