Picking feture dates.
<link href="src/feture-calendar.css" rel="stylesheet">
<div id="f-cal"></div>
<script src="src/feture-calendar.js"></script>
<script>
window.addEventListener('load', function () {
new FetureCalendar(document.getElementById('f-cal'), options)
})
</script>
var defaults = {
months: 3, // initial months
max: 12, // max months
format: 'mm月dd日', // dateformat, supports yyyy,mm,dd
range: ['入住', '离店'], // range text, if unset, select only one date
i18n: {
unit: '晚',
months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
weeks: ['日', '一', '二', '三', '四', '五', '六'],
today: '今天',
y: '年',
m: '月',
d: '日'
},
disablePast: true,
onSelect: console.log
}
- Install dependencies
npm install
- Watch JS/CSS
npm run watch
This project was inspired by Vanilla JS Calendar - @chrisssycollins.