Home

Awesome

vue-monthly-picker

Vue Monthly Picker Components

npm version CircleCI

Checkout demo at https://ittus.github.io/vue-monthly-picker/

Support

<a href="https://www.buymeacoffee.com/8buMYCOog" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;"></a>

Install

npm install vue-monthly-picker --save
import VueMonthlyPicker from 'vue-monthly-picker'
Vue.component('my-component', {
    components: {
        VueMonthlyPicker
    }
});

Usage

<vue-monthly-picker
 v-model="selectedMonth">
</vue-monthly-picker>

Note: v-model binding value need to be a moment object

Available props

PropTypeDefaultDescription
disabledBooleanfalseEnable/disable component
monthLabelsArray['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']Customize month labels
placeHolderString''Place holder when value is null
minmomentnullMinimum time to select
maxmomentnullMaximum time to select
dateFormatStringYYYY/MMDisplay format.
valuemomentnullMoment value of selected month and year
alignmentStringleftAlignment of input value, possible value: left, right, center
selectedBackgroundColorString#007bffBackground color of selected value. It can be HTML color name (red, green, blue) or hexa color code (#00FF00, #0000FF)
clearOptionBooleantrueShow/Hide clear option
inputClassStringinputCustomize css class for visible element

Events

EventParamsDescription
selectedselected month in momentA month has been selected

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# run all tests
npm run test