Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 8a5e434

Browse files
committed
demo: add month picker plugin example, closes #188
1 parent 412fabb commit 8a5e434

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![jsdelivr](https://data.jsdelivr.com/v1/package/npm/vue-flatpickr-component/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vue-flatpickr-component)
55
[![npm-version](https://badgen.net/npm/v/vue-flatpickr-component)](https://www.npmjs.com/package/vue-flatpickr-component)
66
[![github-tag](https://badgen.net/github/tag/ankurk91/vue-flatpickr-component)](https://github.com/ankurk91/vue-flatpickr-component/)
7-
![build](https://github.com/ankurk91/vue-flatpickr-component/workflows/build/badge.svg)
7+
[![build](https://github.com/ankurk91/vue-flatpickr-component/workflows/build/badge.svg)](https://github.com/ankurk91/vue-flatpickr-component/actions)
88
[![codecov](https://codecov.io/gh/ankurk91/vue-flatpickr-component/branch/master/graph/badge.svg)](https://codecov.io/gh/ankurk91/vue-flatpickr-component)
99
[![license](https://badgen.net/github/license/ankurk91/vue-flatpickr-component)](https://yarnpkg.com/en/package/vue-flatpickr-component)
1010

examples/App.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@
121121
</flat-pickr>
122122
</div>
123123

124+
<div class="form-group">
125+
<label>Month picker plugin</label>
126+
<flat-pickr class="form-control"
127+
:config="configs.monthSelect"
128+
v-model="form.monthSelect">
129+
</flat-pickr>
130+
</div>
131+
124132
<div class="row">
125133
<div class="col-md-6">
126134
<div class="form-group">
@@ -189,6 +197,8 @@
189197
// https://chmln.github.io/flatpickr/plugins/
190198
import ConfirmDatePlugin from 'flatpickr/dist/plugins/confirmDate/confirmDate.js';
191199
import 'flatpickr/dist/plugins/confirmDate/confirmDate.css';
200+
import monthSelectPlugin from 'flatpickr/dist/plugins/monthSelect/index.js'
201+
import 'flatpickr/dist/plugins/monthSelect/style.css'
192202
193203
// Override Global settings
194204
flatpickr.setDefaults({
@@ -216,6 +226,7 @@
216226
allowInput: null,
217227
dateStart: null,
218228
dateEnd: null,
229+
monthSelect: null,
219230
},
220231
configs: {
221232
basic: {},
@@ -260,6 +271,14 @@
260271
},
261272
end: {
262273
minDate: null
274+
},
275+
monthSelect: {
276+
plugins: [
277+
new monthSelectPlugin({
278+
shorthand: true,
279+
dateFormat: "m/Y",
280+
})
281+
]
263282
}
264283
},
265284
}

0 commit comments

Comments
 (0)