yarn add apoc-calendar
npm i apoc-calendar
<script src="path/to/apoc-calendar.js></script>
<script>
const calendar = new ApocCalendar({
target: document.getElementById('calendar'),
data: {
head: (year, month) => `${year}.${month}`
day: day => switch (day) {
case 0: {
return '日';
}
case 1: {
return '月';
}
// ...
},
min: '2018-1-1',
max: '2020-12-31',
},
});
</script>
import ApocCalendar from 'apoc-calendar';
const calendar = new ApocCalendar({
target: document.getElementById('calendar'),
data: {...},
});