Closed Dreambox13 closed 7 years ago
Hi, Ok that's kinda weird but lets do this, in this try of example repo dowload the files of the year calendar, maybe could be because do you have an older release, if this do not help please can you share a part of your code, can be linked to a fiddle or just load the files here and we'll see what's going on
Hello, you saved my life. @William-H-M I downloaded your repo I added the files of the calendar and some how my code works. Maybe I had wrong release.
Thank you very much
Hi, great maybe it was and older release as you said, now as this is solved, close this issue.
If any other problem just ask :)
Release downloaded from http://www.bootstrap-year-calendar.com/#Download dons't have yearChanged implementation.
Hi, @x0x01 can you please download the file from the repo as on the page is not updated, if not wrong.
In the repo we have
if(opt.yearChanged) { this.element.bind('yearChanged', opt.yearChanged); }
But on the page just
if(opt.renderEnd) { this.element.bind('renderEnd', opt.renderEnd); }
if(opt.clickDay) { this.element.bind('clickDay', opt.clickDay); }
if(opt.dayContextMenu) { this.element.bind('dayContextMenu', opt.dayContextMenu); }
if(opt.selectRange) { this.element.bind('selectRange', opt.selectRange); }
if(opt.mouseOnDay) { this.element.bind('mouseOnDay', opt.mouseOnDay); }
if(opt.mouseOutDay) { this.element.bind('mouseOutDay', opt.mouseOutDay); }
Hi there,
I wanted to store the year every time the yearChanged is fired. This is the my code:
yearChanged: function(e)
{
var tahun = $('#calendar').data('calendar').getYear();
alert(tahun);
},
However, the calendar is not displayed. When i opened the console, this is the error:
Uncaught TypeError: Cannot read property 'getYear' of undefined
at HTMLDivElement.yearChanged (conv-calendar.html:33)
at HTMLDivElement.dispatch (jquery-2.2.3.min.js:3)
at HTMLDivElement.r.handle (jquery-2.2.3.min.js:3)
at Object.trigger (jquery-2.2.3.min.js:4)
at HTMLDivElement.<anonymous> (jquery-2.2.3.min.js:4)
at Function.each (jquery-2.2.3.min.js:2)
at n.fn.init.each (jquery-2.2.3.min.js:2)
at n.fn.init.trigger (jquery-2.2.3.min.js:4)
at b._triggerEvent (bootstrap-year-calendar.min.js:7)
at b.setYear (bootstrap-year-calendar.min.js:7)
Is there any way to achieve this?
Im trying to use yearChanged method but the function never triggers. The calendar appear in the screen but the method doen't fired. Please help me.
Here is my code:
html
js code