jquery - Javascript advent calendar, trouble with finding date/month -
i newbie question! :) i'am trying utilize advent-calendar found here: https://github.com/tpowell/jsadvent . set demo use, the first door can opened if not december. got working well. when seek create check date itself, doors gets available ever try. below code (i think) checks date:
(function($) { /** calendar action **********/ // sets action on calendar click // illustration default overrides: $('ul.component-calendar').pint_calendar({date:12 }); $.fn.pint_calendar = function(options) { /** user added settings ( pass function/method phone call init ) **/ var settings = $.extend({ // defaults date: 1, //new date().getdate(); set limit day ( days before selectable ) month: 12, //new date().getmonth()+1; sets month set (i.e. december) fadetiming: 300, // when hover on calendar day, 'fade' animation speed dayslideduration: 500 // when click calendar day, 'slide' animation speed }, options); homecoming this.each(function() { var calendar = $(this); calendar.find('li').each(function() { if (settings.month == 12 && settings.date >= parseint($(this).find('.day').text(), 10)) { $(this).addclass('active'); } else { $(this).removeclass('active'); } });
the 2 lines says date:1 , month12 think i'm supposed remove 2 slashes , date:1 , month12, lines begins new date().getdate() , new date().getmonth(). well, tried , not work. code 2011, script opens doors because 2014 now? i've tried find year, can't find anything. or doing things wrong? there out there knows schould done create code check date itself?
i've tried 1 not long ago.
you have set date manually every day far i've read on facebook :(
i've been trying / create working advent calendar weeks , can't life of me figure out haha
javascript jquery date
No comments:
Post a Comment