<script lang="ts">
	import FullCalendar from '$lib/components/FullCalendar.svelte';
	import daygridPlugin from '@fullcalendar/daygrid';
	// import type { EventClickArg } from '@fullcalendar/core';
	import type {CalendarEvent} from './CalendarEvent'
	let calendarRef;
	export let events:CalendarEvent[]
	let options = {
		initialView: 'dayGridMonth',
		plugins: [daygridPlugin],
		locale: 'th',
        headerToolbar: {
			start: 'prev,next',
			center: 'title'
		},
        contentHeight:"auto",
        selectable: true,
        buttonText: {
            month: 'เดือน', 
            agendaDay: 'วัน', 
            agendaWeek: 'สัปดาห์', 
            today: 'วันนี้'
        },
		events,
		// eventClick: clickEvent,
	};
/*
	function clickEvent(info:EventClickArg){
		alert(
			'Event: ' + info.event.title +
			'\nID: ' + info.event.id +
			'\nCoordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY + 
			'\nView: ' + info.view.type
		);
	}	
*/
</script>
<FullCalendar bind:this={calendarRef} {options} />

