-1

I am using Responsive Calendar Plug In which I need to dynamically create events.

How can I pass the arr event array as default event list to the plug in.

code is as follow.

enter image description here

Generated Event List is as follow

enter image description here

any support appreciated.

Actual Code should looks like this, that I need to create the event list from back end and pass it to the the event method.

$(".responsive-calendar").responsiveCalendar({
    time: '2014-04',
    events: {
      "2014-04-30": {"number": 5, "badgeClass": "badge-warning", "url": "http://w3widgets.com/responsive-slider"},
      "2014-04-26": {"number": 1, "badgeClass": "badge-warning", "url": "http://w3widgets.com"}, 
      "2014-05-03": {"number": 1, "badgeClass": "badge-error"}, 
      "2014-06-12": {"class": "active cool"}}
  });

thx

2
  • Adding pictures of your code is not very helpful. Add the actual text instead.
    – Tomanow
    Mar 3, 2014 at 11:47
  • @Tomanow : I have added the actual text
    – TED
    Mar 3, 2014 at 12:04

1 Answer 1

1

can u try like this ?


       <?php 
       $arrEvents = array();

       for($x = 1; $xdateOn = "2014-03-".$x;
       $objCalendar->number = $x;
       $objCalendar->badgeClass = "badge-warning";
       $objCalendar->url = "http://blog.iyngaran.info?id=".$x;
       array_push($arrEvents, $objCalendar);
       }

       ?>



    
       $( document ).ready( function() {
       $(".responsive-calendar").responsiveCalendar({
       time: '2014-03',
       events: {
          $event){?>
          "dateOn);?>": {"number": number);?>, "badgeClass": "badge-warning", "url": "url);?>"},
        
        }
        });
        });
       
    
1
  • It works and this way is easy, rather trying passing to function as java script array.
    – TED
    Mar 20, 2014 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.