Class DateLocale
(Defined in: jpgraph.php : 349)
 
 DateLocale 
 GetDayAbb() 
 GetLongMonthName() 
 GetMonth() 
 GetShortDay() 
 GetShortMonth() 
 GetShortMonthName() 
 Set() 
 __construct() 
 

Class usage and Overview
This class is mainly used (so far) by the Gantt graphs to get localized names of weekdays and months. There is nothing that prevents you from using this to get hold of localized names in your script.

To help with this JpGraph instantiates the global variable $gDateLocale which can be used to access the methods.

A quick example could be to for example get hold of the shortform of the names of the month to use as labels. By default this is set to the dafult locale for the installation.

// Get localized array of short form of month names $months = $gDateLocale->GetShortMonth();

 


Class Methods

 

DateLocale ::
GetDayAbb()
Return array with day abbreviation in the current locale.


Description:
Returns an array with the abbrevation for weekdays using the current locale. 
 
See also:

Example:

$weekdays $gDateLocale->GetDayAbb();

 

DateLocale ::
GetLongMonthName($aNbr)
Get long month name for the specified month

ArgumentDefaultDescription
$aNbr  Number of month [0-11]

Description:
Get the full month name as specified by integer 0-11 
 
See also:

Example:

$jan $gDateLocale->GetLongMonthName(0);

 

DateLocale ::
GetMonth()
Get array of all month names


Description:
Return an array with all months of the year in their long form. 
 
See also:

Example:

$allmonths $gDateLocale->GetMonth();
$graph->xaxis->SetTickLabels($allmonths);

 

DateLocale ::
GetShortDay()
Return an array with all weekdays in the short form.


Description:
Return an array with all weekdays in the short form according to the specified locale. For english locale this would return array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); 

Example:

$alldays $gDateLocale->GetShortDay();

 

DateLocale ::
GetShortMonth()
Short month description


Description:
Return an array of the short names for all months 

Example:

$allmonths $gDateLocale->GetShortMonth();

 

DateLocale ::
GetShortMonthName($aNbr)
Return the short month name for the specified month.

ArgumentDefaultDescription
$aNbr  Number of month [0-11]

Description:
Return the short month name for the specified month. 
 
See also:

Example:

$april $gDateLocale->GetShortMonthName(3);

 

DateLocale ::
Set($aLocale)
Set locale

ArgumentDefaultDescription
$aLocale  Locale

Description:
See PHP manual for more details. The argument should be a valid locale setting. For example 'EN_US' or 'EN_UK' The following table lists some commonly used locales. The exact locales available depends on the system
af_ZA ar_AE ar_AE.utf8
ar_BH ar_BH ar_BH.utf8 ar_DZ ar_DZ.utf8
ar_EG ar_EG ar_EG.utf8 ar_IN ar_IQ
ar_IQ.utf8 ar_IQ.utf8 ar_JO ar_JO.utf8 ar_KW
ar_KW.utf8 ar_KW.utf8 ar_LB ar_LB.utf8 ar_LY
ar_LY.utf8 ar_LY.utf8 ar_MA ar_MA.utf8 ar_OM
ar_OM.utf8 ar_OM.utf8 ar_QA ar_QA.utf8 ar_SA
ar_SA.utf8 ar_SA.utf8 ar_SD ar_SD.utf8 ar_SY
ar_SY.utf8 ar_SY.utf8 ar_TN ar_TN.utf8 ar_YE
ar_YE.utf8 ar_YE.utf8 be_BY be_BY.utf8 bg_BG
bg_BG.utf8 bg_BG.utf8 bokmal bokm?l br_FR
bs_BA bs_BA ca_ES ca_ES.utf8 ca_ES@euro
catalan catalan croatian cs_CZ cs_CZ.utf8
cy_GB cy_GB czech da_DK da_DK.utf8
danish danish dansk de_AT de_AT.utf8
de_AT@euro de_AT@euro de_BE de_BE@euro de_CH
de_CH.utf8 de_CH.utf8 de_DE de_DE.utf8 de_DE@euro
de_LU de_LU de_LU.utf8 de_LU@euro deutsch
dutch dutch eesti el_GR el_GR.utf8
en_AU en_AU en_AU.utf8 en_BE en_BE.utf8
en_BE@euro en_BE@euro en_BW en_CA en_CA.utf8
en_DK en_DK en_GB en_GB.utf8 en_HK
en_IE en_IE en_IE.utf8 en_IE@euro en_IN
en_NZ en_NZ en_NZ.utf8 en_PH en_SG
en_US en_US en_US.utf8 en_ZA en_ZA.utf8
en_ZW en_ZW es_AR es_AR.utf8 es_BO
es_BO.utf8 es_BO.utf8 es_CL es_CL.utf8 es_CO
es_CO.utf8 es_CO.utf8 es_CR es_CR.utf8 es_DO
es_DO.utf8 es_DO.utf8 es_EC es_EC.utf8 es_ES
es_ES.utf8 es_ES.utf8 es_ES@euro es_GT es_GT.utf8
es_HN es_HN es_HN.utf8 es_MX es_MX.utf8
es_NI es_NI es_NI.utf8 es_PA es_PA.utf8
es_PE es_PE es_PE.utf8 es_PR es_PR.utf8
es_PY es_PY es_PY.utf8 es_SV es_SV.utf8
es_US es_US es_UY es_UY.utf8 es_VE
es_VE.utf8 es_VE.utf8 estonian et_EE et_EE.utf8
eu_ES eu_ES eu_ES@euro fa_IR.utf8 fi_FI
fi_FI.utf8 fi_FI.utf8 fi_FI@euro finnish fo_FO
fo_FO.utf8 fo_FO.utf8 fr_BE fr_BE.utf8 fr_BE@euro
fr_CA fr_CA fr_CA.utf8 fr_CH fr_CH.utf8
fr_FR fr_FR fr_FR.utf8 fr_FR@euro fr_LU
fr_LU.utf8 fr_LU.utf8 fr_LU@euro fran?ais french
ga_IE ga_IE ga_IE.utf8 ga_IE@euro galego
galician galician german gl_ES gl_ES.utf8
gl_ES@euro gl_ES@euro greek gv_GB he_IL
he_IL.utf8 he_IL.utf8 hebrew hi_IN.utf8 hr_HR
hr_HR.utf8 hr_HR.utf8 hrvatski hu_HU hu_HU.utf8
hungarian hungarian icelandic id_ID id_ID.utf8
is_IS is_IS is_IS.utf8 it_CH it_CH.utf8
it_IT it_IT it_IT.utf8 it_IT@euro italian
iw_IL iw_IL ja_JP ja_JP.eucjp ja_JP.sjis
ja_JP.ujis ja_JP.ujis ja_JP.utf8 japanese japanese.euc
japanese.sjis japanese.sjis ka_GE kl_GL kl_GL.utf8
ko_KR ko_KR ko_KR.euckr ko_KR.utf8 korean
korean.euc korean.euc kw_GB lithuanian lt_LT
lt_LT.utf8 lt_LT.utf8 lv_LV lv_LV.utf8 mi_NZ
mk_MK mk_MK mk_MK.utf8 mr_IN.utf8 ms_MY
mt_MT mt_MT nb_NO nb_NO.ISO-8859-1 nl_BE
nl_BE.utf8 nl_BE.utf8 nl_BE@euro nl_NL nl_NL.utf8
nl_NL@euro nl_NL@euro nn_NO no_NO no_NO.utf8
norwegian norwegian nynorsk oc_FR pl_PL
pl_PL.utf8 pl_PL.utf8 polish portuguese pt_BR
pt_BR.utf8 pt_BR.utf8 pt_PT pt_PT.utf8 pt_PT@euro
ro_RO ro_RO ro_RO.utf8 romanian ru_RU
ru_RU.koi8r ru_RU.koi8r ru_RU.utf8 ru_UA russian
sh_YU sh_YU sh_YU.utf8 sk_SK sk_SK.utf8
sl_SI sl_SI sl_SI.utf8 slovak slovene
slovenian slovenian spanish sq_AL sq_AL.utf8
sr_YU sr_YU sr_YU.utf8 sr_YU@cyrillic sv_FI
sv_FI.utf8 sv_FI.utf8 sv_FI@euro sv_SE sv_SE.utf8
swedish swedish ta_IN te_IN tg_TJ
th_TH th_TH th_TH.utf8 thai tl_PH
tr_TR tr_TR tr_TR.utf8 turkish uk_UA
uk_UA.utf8 uk_UA.utf8 ur_PK uz_UZ vi_VN
vi_VN.utf8 vi_VN.utf8 yi_US zh_CN zh_CN.gb18030
zh_CN.gbk zh_CN.gbk zh_CN.utf8 zh_HK zh_HK.utf8
zh_TW zh_TW zh_TW.euctw zh_TW.utf8
 

Example:

$gDateLocale->Set('sv_SE'); // Set Swedish locale

 

DateLocale ::
__construct()
Constructor


Description:
Construct a new DateLocale. 

Example:

$dateLocale = new DateLocale();
// Use Swedish locale
$dateLocale->Set('sv_SE');