<script lang="ts">
	import FullCalendar from '$lib/components/FullCalendar.svelte';
	import daygridPlugin from '@fullcalendar/daygrid';
	import type {CalendarEvent} from '$lib/data/CMSDataType'
	let calendarRef;
	export let events:CalendarEvent[]
	let options = {
		initialView: 'dayGridMonth',
		plugins: [daygridPlugin],
		locale: 'th',
		headerToolbar: {
			left: 'title',
			center: '',
			right: 'prev next today'
		},
		dayMaxEventRows:3,
		moreLinkContent:function(args: { num: number; }){
        	return '+'+args.num+' เพิ่มเติม';
    	},
        contentHeight:"auto",
        selectable: true,
        buttonText: {
            month: 'เดือน', 
            agendaDay: 'วัน', 
            agendaWeek: 'สัปดาห์', 
            today: 'วันนี้'
        },
		events,
	};
</script>
<FullCalendar bind:this={calendarRef} {options} />

