123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- /* ------------------------------------------------------------------------------
- *
- * # Fullcalendar basic options
- *
- * Demo JS code for extra_fullcalendar_views.html and extra_fullcalendar_styling.html pages
- *
- * ---------------------------------------------------------------------------- */
- // Setup module
- // ------------------------------
- var FullCalendarBasic = function() {
- //
- // Setup module components
- //
- // Basic calendar
- var _componentFullCalendarBasic = function() {
- if (!$().fullCalendar) {
- console.warn('Warning - fullcalendar.min.js is not loaded.');
- return;
- }
- // Add demo events
- // ------------------------------
- // Default events
- var events = [
- {
- title: 'All Day Event',
- start: '2014-11-01'
- },
- {
- title: 'Long Event',
- start: '2014-11-07',
- end: '2014-11-10'
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: '2014-11-09T16:00:00'
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: '2014-11-16T16:00:00'
- },
- {
- title: 'Conference',
- start: '2014-11-11',
- end: '2014-11-13'
- },
- {
- title: 'Meeting',
- start: '2014-11-12T10:30:00',
- end: '2014-11-12T12:30:00'
- },
- {
- title: 'Lunch',
- start: '2014-11-12T12:00:00'
- },
- {
- title: 'Meeting',
- start: '2014-11-12T14:30:00'
- },
- {
- title: 'Happy Hour',
- start: '2014-11-12T17:30:00'
- },
- {
- title: 'Dinner',
- start: '2014-11-12T20:00:00'
- },
- {
- title: 'Birthday Party',
- start: '2014-11-13T07:00:00'
- },
- {
- title: 'Click for Google',
- url: 'http://google.com/',
- start: '2014-11-28'
- }
- ];
- // Event colors
- var eventColors = [
- {
- title: 'All Day Event',
- start: '2014-11-01',
- color: '#EF5350'
- },
- {
- title: 'Long Event',
- start: '2014-11-07',
- end: '2014-11-10',
- color: '#26A69A'
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: '2014-11-09T16:00:00',
- color: '#26A69A'
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: '2014-11-16T16:00:00',
- color: '#5C6BC0'
- },
- {
- title: 'Conference',
- start: '2014-11-11',
- end: '2014-11-13',
- color: '#546E7A'
- },
- {
- title: 'Meeting',
- start: '2014-11-12T10:30:00',
- end: '2014-11-12T12:30:00',
- color: '#546E7A'
- },
- {
- title: 'Lunch',
- start: '2014-11-12T12:00:00',
- color: '#546E7A'
- },
- {
- title: 'Meeting',
- start: '2014-11-12T14:30:00',
- color: '#546E7A'
- },
- {
- title: 'Happy Hour',
- start: '2014-11-12T17:30:00',
- color: '#546E7A'
- },
- {
- title: 'Dinner',
- start: '2014-11-12T20:00:00',
- color: '#546E7A'
- },
- {
- title: 'Birthday Party',
- start: '2014-11-13T07:00:00',
- color: '#546E7A'
- },
- {
- title: 'Click for Google',
- url: 'http://google.com/',
- start: '2014-11-28',
- color: '#FF7043'
- }
- ];
- // Event background colors
- var eventBackgroundColors = [
- {
- title: 'All Day Event',
- start: '2014-11-01'
- },
- {
- title: 'Long Event',
- start: '2014-11-07',
- end: '2014-11-10',
- color: '#DCEDC8',
- rendering: 'background'
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: '2014-11-06T16:00:00'
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: '2014-11-16T16:00:00'
- },
- {
- title: 'Conference',
- start: '2014-11-11',
- end: '2014-11-13'
- },
- {
- title: 'Meeting',
- start: '2014-11-12T10:30:00',
- end: '2014-11-12T12:30:00'
- },
- {
- title: 'Lunch',
- start: '2014-11-12T12:00:00'
- },
- {
- title: 'Happy Hour',
- start: '2014-11-12T17:30:00'
- },
- {
- title: 'Dinner',
- start: '2014-11-24T20:00:00'
- },
- {
- title: 'Meeting',
- start: '2014-11-03T10:00:00'
- },
- {
- title: 'Birthday Party',
- start: '2014-11-13T07:00:00'
- },
- {
- title: 'Vacation',
- start: '2014-11-27',
- end: '2014-11-30',
- color: '#FFCCBC',
- rendering: 'background'
- }
- ];
- // Initialization
- // ------------------------------
- // Basic view
- $('.fullcalendar-basic').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,basicWeek,basicDay'
- },
- defaultDate: '2014-11-12',
- editable: true,
- events: events,
- eventLimit: true,
- isRTL: $('html').attr('dir') == 'rtl' ? true : false
- });
- // Agenda view
- $('.fullcalendar-agenda').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- defaultDate: '2014-11-12',
- defaultView: 'agendaWeek',
- editable: true,
- businessHours: true,
- events: events,
- isRTL: $('html').attr('dir') == 'rtl' ? true : false
- });
- // List view
- $('.fullcalendar-list').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'listDay,listWeek,listMonth'
- },
- views: {
- listDay: { buttonText: 'Day' },
- listWeek: { buttonText: 'Week' },
- listMonth: { buttonText: 'Month' }
- },
- defaultView: 'listMonth',
- defaultDate: '2014-11-12',
- navLinks: true, // can click day/week names to navigate views
- editable: true,
- eventLimit: true, // allow "more" link when too many events
- events: events,
- isRTL: $('html').attr('dir') == 'rtl' ? true : false
- });
- // Event colors
- $('.fullcalendar-event-colors').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- defaultDate: '2014-11-12',
- editable: true,
- events: eventColors,
- isRTL: $('html').attr('dir') == 'rtl' ? true : false
- });
- // Event background colors
- $('.fullcalendar-background-colors').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- defaultDate: '2014-11-12',
- editable: true,
- events: eventBackgroundColors,
- isRTL: $('html').attr('dir') == 'rtl' ? true : false
- });
- };
- //
- // Return objects assigned to module
- //
- return {
- init: function() {
- _componentFullCalendarBasic();
- }
- }
- }();
- // Initialize module
- // ------------------------------
- document.addEventListener('DOMContentLoaded', function() {
- FullCalendarBasic.init();
- });
|