FullCalendar:eventColor,eventBackgroundColor, eventBorderColor,

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>背景色設定</title>
<link href='../fullcalendar.min.css' rel='stylesheet' />
<link href='../fullcalendar.print.min.css' rel='stylesheet' media='print' />
<script src='../lib/moment.min.js'></script>
<script src='../lib/jquery.min.js'></script>
<script src='../fullcalendar.min.js'></script>
<script>
   // ver 3.1.2 當前最新版本,塗聚文Geovin Du 註
	$(document).ready(function() {

		$('#calendar').fullCalendar({
			header: {
				left: 'prev,next today',
				center: 'title',
				right: 'month,agendaWeek,agendaDay,listMonth'
			},
			defaultDate: '2017-04-12',
			navLinks: true, // can click day/week names to navigate views
			//businessHours: true, // display business hours 默認設置工作時間和日期
			businessHours:{    // days of week. an array of zero-based day of week integers (0=Sunday)   true  
                dow: [ 1, 2, 3, 4, 5 ], // Monday - Fri    
                start: '09:00', // a start time (09am in this example)    
                end: '18:00', // an end time (6pm in this example)
                overlap: false,
               rendering: 'background', //自定背景色
               color: '#ffffe0'
            },
			editable: true,
			events: [
				{
					title: 'Business Lunch',
					start: '2017-04-03T13:00:00',
					constraint: 'businessHours'
				},
				{
					title: 'Meeting',
					start: '2017-04-13T11:00:00',
					constraint: 'availableForMeeting', // defined below
					
				},
				{
					title: 'Conference',
					start: '2017-04-18',
					end: '2017-04-20'
				},
				{
					title: 'Party',
					start: '2017-04-29T20:00:00'
				},

				// areas where "Meeting" must be dropped
				{
					id: 'availableForMeeting',
					title: 'availableForMeeting',
					start: '2017-04-11T10:00:00',
					end: '2017-04-11T16:00:00',
					//rendering: 'border-color', //自定指定時間段的樣式					
					//color: '#ff9f89'
                 //或
                 	//backgroundColor:'#cccccc',
					//textColor:'#ff9f89',
					//borderColor:'#9999f89'

	
				},
				{
					id: 'availableForMeeting',
					start: '2017-04-13T10:00:00',
					end: '2017-04-13T16:00:00',			
					//rendering: 'background-color', //自定指定時間段的樣式
					//color: '#ff9f89'

					
				},

				// red areas where no events can be dropped
				{
					start: '2017-04-24',
					end: '2017-04-28',
					overlap: false,
				
				},
				{
					start: '2017-04-06',
					end: '2017-04-08',
					overlap: false,
					
				}
			],
			//eventColor: '#378006', //
			eventTextColor: 'black',
			eventBorderColor:'red',
			eventBackgroundColor:'green'
		});
		
	});

</script>
<style type="text/css">

	body {
		margin: 40px 10px;
		padding: 0;
		font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
		font-size: 14px;
	}

	#calendar {
		max-width: 900px;
		margin: 0 auto;
	}

</style>
</head>
<body>

	<div id='calendar'></div>

</body>
</html>

https://fullcalendar.io/docs1/event_data/Event_Source_Object/

color,background-color,border-color

相关推荐