-3

Can't use variable to set date dynamically in my events? Using my "curr_date" variable below, I want to use this to pass to the events property of the function, such as the string literal is passed but it is not working.

var curr_date = yyyy+'-'+mm+'-'+dd;

$(document).ready(function () {
  $(".responsive-calendar").responsiveCalendar({
    time: yyyy+'-'+mm,
    events: {
      "2016-12-03": {"number": 1},
      curr_date : {}}
  });
});

I know there might be already similar questions to this, however, I do not know the exact wording of what I am trying to accomplish thus my posting.

arias_JC
  • 549
  • 3
  • 15

1 Answers1

1

try this

var curr_date = yyyy+'-'+mm+'-'+dd;
    $(document).ready(function () {
      var events = {
        time: yyyy+'-'+mm,
        events: {
          "2016-12-03": {"number": 1}
        }
      }
      events.events[curr_date] = {};
      $(".responsive-calendar").responsiveCalendar(events);
    });
Joe Hany
  • 1,015
  • 1
  • 8
  • 14