brospars / simple-calendar

Simple calendar jquery plugin
https://brospars.github.io/simple-calendar
MIT License
49 stars 38 forks source link

Getting instance of plugin #6

Closed brospars closed 5 years ago

brospars commented 5 years ago

pardon me for interrupting. But How can i get an instance of the plugin, in case I need to update the values on month change. I tried assigning to variable and calling var.simpleCalendar.function() but did not work. Any help would be appreciated..

Originally posted by @monsterbrain in https://github.com/brospars/simple-calendar/issues/2#issuecomment-468595743

brospars commented 5 years ago

I don't think you can but I'm currently adding callback functions to be able to do just that. I'll keep you inform

monsterbrain commented 5 years ago

I searched the web & found that the return function in the plugin is a bit different. After going through it, I found it is added as data reference.

I was able to achieve to get the plugin by this code.

var cal = $("#container").simpleCalendar({
                fixedStartDay: false
            });

cal.data('plugin_simpleCalendar').testFunction(123);