jquery - Fullcalendar (full calendar) Not defaulting to display the current today's date. Month shows february and not today's -
i trying calendar invoke today function or set date current date. when calendar first loads shows calendar month february. there button can click called 'today' switch date today's date. invoke function or set current date today's date.
documentation of jquery plugin can found if google adam shaw fullcalendar jquery plugin. http://arshaw.com/fullcalendar/. can see example set current today's date.
my code follows:
//loads fullcalender in head use <div id='calendar'></div> display function render_calendar(){ //calendar [1] ?> <script type='text/javascript'> <?php $calendar = "#"; ?> <?php $calendar .= get_option('fc_option_calendar'); ?> jquery(document).ready(function($) { // $() work alias jquery() inside of function $(document).ready(function() { $('<?php echo $calendar ?>').fullcalendar({ header: { left: 'prev, next today, agenda', center: 'title', right: 'month, agendaweek, agendaday', ignoretimezone: false }, // multiple sources eventsources: [ '<?php echo get_option('fc_option_feed1'); ?>', '<?php echo get_option('fc_option_feed2'); ?>', '<?php echo get_option('fc_option_feed3'); ?>' ], events: { //http://www.google.com/calendar/feeds/centre.edu_5f119bnujdfol3gs59h0driv9c%40group.calendar.google.com/public/basic //url: '<?php echo get_option('fc_option_feed1'); ?>', classname: 'gcal-event', // option! currenttimezone: 'america/chicago', // option! }, month: true, week: true, day: true, agenda: true, basic: true, //showagendabutton: true }); }); }); </script> <script type='text/javascript'>
it because of month option setting, used set
the initial month when calendar loads.
try
$(document).ready(function() { $('<?php echo $calendar ?>').fullcalendar({ header: { left: 'prev, next today, agenda', center: 'title', right: 'month, agendaweek, agendaday', ignoretimezone: false }, // multiple sources eventsources: [ '<?php echo get_option('fc_option_feed1'); ?>', '<?php echo get_option('fc_option_feed2'); ?>', '<?php echo get_option('fc_option_feed3'); ?>' ], events: { //http://www.google.com/calendar/feeds/centre.edu_5f119bnujdfol3gs59h0driv9c%40group.calendar.google.com/public/basic //url: '<?php echo get_option('fc_option_feed1'); ?>', classname: 'gcal-event', // option! currenttimezone: 'america/chicago', // option! }, week: true, day: true, agenda: true, basic: true, //showagendabutton: true }); });
Comments
Post a Comment