Welcome Guest, Not a member yet? Register   Sign In
class CI_Calendar->get_month_name() - Wrong month name for month May
#2

[eluser]xwero[/eluser]
Nice catch but i think CI would be better off using the php functions set_locale and strftime. Then loading of a language file isn't needed to internationalize your app.
Code:
$display = ($this->month_type == 'short')?'%b':'%B';
$month_names = array();

for($i=1, $max=12;$i<=$max;$i++)
{
  $month_names[str_pad($i,2,0,STR_PAD_LEFT)] = strftime($display,mktime(0,0,0,$i,1,1970));
}


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



Theme © iAndrew 2016 - Forum software by © MyBB