Options in data-***, passed using data API, doesn't work

Create issue
Issue #64 new
Former user created an issue

Options in data-*, passed using data API, doesn't work For example data-translate-months Working solution:

    $(document).ready(function(){
      $('.responsive-calendar').each(function(){
        spy = $(this);
        opts = {};
        if ((spy.data('translate-months')) != null) {
          opts.translateMonths = spy.data('translate-months').split(',');
        }
        if ((spy.data('time')) != null) {
          opts.time = spy.data('time');
        }
        if ((spy.data('all-rows')) != null) {
          opts.allRows = spy.data('all-rows');
        }
        if ((spy.data('start-from-sunday')) != null) {
          opts.startFromSunday = spy.data('start-from-sunday');
        }
        if ((spy.data('activate-non-current-months')) != null) {
          opts.activateNonCurrentMonths = spy.data('activate-non-current-months');
        }
        if ((spy.data('month-change-animation')) != null) {
          opts.monthChangeAnimation = spy.data('month-change-animation');
        }
        return spy.responsiveCalendar(opts);
      });
    });

Comments (0)

  1. Log in to comment