Welcome Guest, Not a member yet? Register   Sign In
calendar specific date
#3

[eluser]Cristian Gilè[/eluser]
Code:
$list = $this->news_model->get_list()->result();

$cal = array();

foreach($list as $item)
{
  $year = date('Y',$item->date); //I assume that you have stored the news date as int in your db
  $month = date('m',$item->date);
  $day = date('d',$item->date);
  
  $cal[$year][$month][$day] = $item->news_text;
}

$data['calendar'] = $this->calendar->generate('','',$cal); //pass this to your view

Change $item->date and $item->news_text according to your db fields.

Cristian Gilè


Messages In This Thread
calendar specific date - by El Forum - 01-13-2011, 09:27 AM
calendar specific date - by El Forum - 01-14-2011, 07:58 AM
calendar specific date - by El Forum - 01-14-2011, 08:16 AM
calendar specific date - by El Forum - 01-14-2011, 08:20 AM
calendar specific date - by El Forum - 01-14-2011, 08:29 AM
calendar specific date - by El Forum - 01-14-2011, 08:47 AM
calendar specific date - by El Forum - 01-14-2011, 09:09 AM
calendar specific date - by El Forum - 01-14-2011, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB