Welcome Guest, Not a member yet? Register   Sign In
Adding multiple variables to calendar days
#7

Hey thanks for writing back. I am trying to understand you but there is somethign missing still Smile  (it's me not you)

I applied your code here -> http://webmoosh.com/ we can track it there.

The part I am not getting is passing the values to each day.

The jquery and css styling part is easy as long as I can dynamically add classes to each day.

First requirement is that every single day is a link. That part is ok for now howver the challenge is dynamcially adding class. Here's what I mean:

See here below is the view. I have list of tasks with date in $task array.

If the date of the task matches the calendar date then I wanna add a class.

PHP Code:
while($month<12)
 
  {
 
  $data=array();
 
         $days=0;
 
         $month++;
 
         while($days<32)
 
  {
 
  $days++;
 
             foreach($tasks as $row => $val)
 
               {
 
                 if(strtotime($year."-".$month."-".$days)==strtotime($val['date_added']))
 
                   {
 
                       //$data[$days] = array('days'=>$days,'class'=>'active');
 
                       $data[$days] = $days;
 
                   }
 
               }
 
           
 
         ?>
   <div class="col-md-2"><?php echo $this->calendar->generate($year,$month$data);?></div>
   <?php
   
if($month==6)
 
  {
 
  ?></div><div class="row"><?php
   
}
 
  ?>

Thanks for helping Smile
Reply


Messages In This Thread
RE: Adding multiple variables to calendar days - by behnampmdg3 - 08-03-2017, 03:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB