CodeIgniter Forums
Calendar class problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Calendar class problem (/showthread.php?tid=12371)



Calendar class problem - El Forum - 10-16-2008

[eluser]demogar[/eluser]
Hey there!
I'm getting troubles with the calendar class. I set up the library and it continues with the default configuration.

In the controller
Code:
#Cargando calendario
// Configuraciones
$config = array(
  'start_day'        =>    'monday'
);
        
// Cargando libreria
$this->load->library('calendar', $config);
        
#Mes y año actual
$variables['mes']    = date('n');
$variables['ano']    = date('Y');

In the view
Code:
<?=$this->calendar->generate($ano, $mes); ?>

And the calendar starts sunday... The only way I achieve it to start on mondays is setting this on the calendar library itself.

What I'm doing wrong?

Thank you in advance


Calendar class problem - El Forum - 10-17-2008

[eluser]GSV Sleeper Service[/eluser]
is the calendar library being autoloaded?


Calendar class problem - El Forum - 10-17-2008

[eluser]Yash[/eluser]
use autoload to load calendar class

and use this function
Code:
$config = array(
  'start_day'        =>    'monday'
);
    
            
$this->calendar->initialize($config);



Calendar class problem - El Forum - 10-17-2008

[eluser]demogar[/eluser]
Thank you very much both!
It works great