Skip to content

Commit

Permalink
demo: add month picker plugin example, closes #188
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurk91 committed May 13, 2020
1 parent 412fabb commit 8a5e434
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![jsdelivr](https://data.jsdelivr.com/v1/package/npm/vue-flatpickr-component/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vue-flatpickr-component)
[![npm-version](https://badgen.net/npm/v/vue-flatpickr-component)](https://www.npmjs.com/package/vue-flatpickr-component)
[![github-tag](https://badgen.net/github/tag/ankurk91/vue-flatpickr-component)](https://github.com/ankurk91/vue-flatpickr-component/)
![build](https://github.com/ankurk91/vue-flatpickr-component/workflows/build/badge.svg)
[![build](https://github.com/ankurk91/vue-flatpickr-component/workflows/build/badge.svg)](https://github.com/ankurk91/vue-flatpickr-component/actions)
[![codecov](https://codecov.io/gh/ankurk91/vue-flatpickr-component/branch/master/graph/badge.svg)](https://codecov.io/gh/ankurk91/vue-flatpickr-component)
[![license](https://badgen.net/github/license/ankurk91/vue-flatpickr-component)](https://yarnpkg.com/en/package/vue-flatpickr-component)

Expand Down
19 changes: 19 additions & 0 deletions examples/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@
</flat-pickr>
</div>

<div class="form-group">
<label>Month picker plugin</label>
<flat-pickr class="form-control"
:config="configs.monthSelect"
v-model="form.monthSelect">
</flat-pickr>
</div>

<div class="row">
<div class="col-md-6">
<div class="form-group">
Expand Down Expand Up @@ -189,6 +197,8 @@
// https://chmln.github.io/flatpickr/plugins/
import ConfirmDatePlugin from 'flatpickr/dist/plugins/confirmDate/confirmDate.js';
import 'flatpickr/dist/plugins/confirmDate/confirmDate.css';
import monthSelectPlugin from 'flatpickr/dist/plugins/monthSelect/index.js'
import 'flatpickr/dist/plugins/monthSelect/style.css'
// Override Global settings
flatpickr.setDefaults({
Expand Down Expand Up @@ -216,6 +226,7 @@
allowInput: null,
dateStart: null,
dateEnd: null,
monthSelect: null,
},
configs: {
basic: {},
Expand Down Expand Up @@ -260,6 +271,14 @@
},
end: {
minDate: null
},
monthSelect: {
plugins: [
new monthSelectPlugin({
shorthand: true,
dateFormat: "m/Y",
})
]
}
},
}
Expand Down

0 comments on commit 8a5e434

Please sign in to comment.