• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
class CI_Calendar->get_month_name() - Wrong month name for month May

#1
[eluser]fensen[/eluser]
Detected in CodeIgniter_1.6.3

$month_names[5] has the same value both in
month_type == 'short'
and
month_type == 'long'.

Code:
function get_month_name($month)
{
if ($this->month_type == 'short')
{
$month_names = array(
'01' => 'cal_jan',
'02' => 'cal_feb',
'03' => 'cal_mar',
'04' => 'cal_apr',
'05' => 'cal_may',
'06' => 'cal_jun',
'07' => 'cal_jul',
'08' => 'cal_aug',
'09' => 'cal_sep',
'10' => 'cal_oct',
'11' => 'cal_nov',
'12' => 'cal_dec'
);
}
else
{
$month_names = array(
'01' => 'cal_january',
'02' => 'cal_february',
'03' => 'cal_march',
'04' => 'cal_april',
'05' => 'cal_may',
'06' => 'cal_june',
'07' => 'cal_july',
'08' => 'cal_august',
'09' => 'cal_september',
'10' => 'cal_october',
'11' => 'cal_november',
'12' => 'cal_december'
);
}
...
}

According to "/language/xxx/calendar_lang.php", the long version should be 'cal_mayl' as follows:

Code:
if ($this->month_type == 'short')
{
  $month_names = array(
    ...
    '05' => 'cal_may',
    ...
  );
}
else
{
  $month_names = array(
    ...
    '05' => 'cal_mayl',
    ...
  );
}

In English it's not a problem because the name of the month "May" is the same, short or long version.

But in other languages it is an issue.

Thanks


Fabian


Messages In This Thread
class CI_Calendar->get_month_name() - Wrong month name for month May - by El Forum - 09-01-2008, 02:02 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.