vue-double-calendar
git: github.com/FlyingLxy/vue-double-calendar
A Vue.js component
Install
npm install vue-double-calendar --save
Option
- begin String: Start Date. Default: new Date()
- end String: End Date. Default: new Date()
- isShow Boolean: Show Trigger. Default: true
- className String: Container class. Default: 'double-calendar-container'
- menus Array: Custom menus button. Format for: ['Today','The Month']
- menuHandler CallBack: Click menus callBack. Param: String. The current name click on the menu
- change CallBack: Date change callBack. Param: Object. 'start' Start date. and 'end' End date
- confirm CallBack: Confirm button callBack. Param: Object. 'start' Start date. and 'end' End date
- cancel CallBack: Cancel button callBack. Param: Object. 'start' Start date. and 'end' End date
Example
// xx.vue// script<script>; //util.js { var y = date; var m = date + 1; var d = date; mlength === 1 && m = '0' + m; dlength === 1 && d = '0' + d; return `--{d}`} { var date = ; var end = date + 60 * 60 * 24 * 7 * 1000 return begin: end: menus: 'Today' 'Month' 'Quarter' isShow: true } components: DoubleCalendar methods: { // obj.start '2016-06-20' thisbegin = objstart; // obj.end '2016-7-29' thisend = objend; //...code } { if name === 'today' var date = thisbegin = ; thisend = ; //...code } { //obj { start: 'xxxx-xx-xx', end: 'xxxx-xx-xx'} thisisShow = false; //...code } { //obj { start: 'xxxx-xx-xx', end: 'xxxx-xx-xx'} thisisShow = false; //...code } </script> // template<template> <double-calendar className="myCalendar" :begin="begin" :end="end" :menus="menus" :isShow="isShow" @change="dateHandler" @menuHandler="menuHandler" @confirm="confirmHandler" @cancel="cancelHandler" > <double-calendar></template>