Last active
August 29, 2015 14:08
-
-
Save vishalbasnet23/85c199b92b6208924a6b to your computer and use it in GitHub Desktop.
Simple Event Calender using jQuery and PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Enqueue fullcalender.io ---> | |
| <style> | |
| #calendar { | |
| max-width: 900px; | |
| margin: 0 auto; | |
| } | |
| </style> | |
| <?php | |
| for ( $upcoming_events as $upcoming_event ) { | |
| $upcoming_event_object = array( | |
| 'title' => $upcoming_event_name, | |
| 'start' => $upcoming_event_start_time, | |
| 'end' => $upcoming_event_end_time | |
| ); | |
| array_push($event_calender_big_array, $upcoming_event_object); | |
| } | |
| $event_calender_json = json_encode($event_calender_big_array); | |
| ?> | |
| <div id='calendar'></div> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| $('#calendar').fullCalendar({ | |
| header: { | |
| left: 'prev,next today', | |
| center: 'title', | |
| right: 'month,basicWeek,basicDay' | |
| }, | |
| defaultDate: "<?php echo date('F,Y');?>", | |
| editable: false, | |
| eventLimit: true, // allow "more" link when too many events | |
| events: <?php echo $event_calender_json;?> | |
| }); | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment