A Simple And Elegant Month Picker for Vue Plugin

VueMonthPicker is A lightweight month picker for Vue.js with no dependencies.

month picker bs, month picker flutter, month picker html, month picker example, month year picker bs, multiple month picker jquery, month picker javascript

How to make use of it:

Install & Download:

# Yarn
$ yarn add vue-month-picker

# NPM
$ npm install vue-month-picker --save

Bundler (Webpack, Rollup)

import Vue from 'vue'
import { MonthPicker } from 'vue-month-picker'
import { MonthPickerInput } from 'vue-month-picker'

Vue.use(MonthPicker)
Vue.use(MonthPickerInput)
<template>
  <month-picker-input :no-default="true"></month-picker-input>
</template>

<script>
import { MonthPickerInput } from 'vue-month-picker'

export default {
    components: {
        MonthPickerInput
    }
}
</script>
<template>
    <p>{{ date.month }}</p>
  <month-picker @change="showDate"></month-picker>
</template>

<script>
import { MonthPicker } from 'vue-month-picker'

export default {
    data() {
        return {
            date: {
                from: null,
                to: null,
                month: null,
                year: null
            }
        }
    },
    components: {
        MonthPicker
    },
    methods: {
        showDate (date) {
            this.date = date
        }
    }
}
</script>

Api

The MonthPicker and the MonthPickerInput shares the same props and events.

Props

PropTypeDefaultDescription
langStringenThe language of the months.
monthsArray[]Custom months if language is unsupported.
default-monthInteger The default selected month of the month picker. To show the month picker unselected, use the no-default prop.
default-yearInteger The default year of the month picker.
no-defaultBooleanfalseShow the month picker unselected.
show-yearBooleanfalseShow the year picker.
editable-yearBooleanfalseYear appears as a input field.
clearableBooleanfalsePossible to clear the chosen month.
variantStringdefaultColor variant. Currently supports default and dark.
year-onlyBooleanfalseHide the months so it acts as a pure year picker
max-dateDatenullSet a max date. Higher dates will be disabled.
min-dateDatenullSet a mih date. Higher dates will be disabled.
input-pre-filledBooleanfalseOnly applies for <month-picker-input>. Input will be pre filled if default-year and default-month is set.

Events

EventReturnsDescription
@changeObjectIndicates that the value has been changed. NB, this will fire when a default value has been selected when the month picker is mounted. Use the input event if you want the value the user has selected.
@change-yearNumberIndicates that the year has been changed. Will emit the year value.
@inputObjectIndicates that the value has been changed by the user.
@clear Indicates that user have cleared the selected value

Date object

Change and input events returns a date object with the following properties:

  • from: Start of the month.
  • to: End of the month.
  • month: Selected month.
  • monthIndex: Selected month index.
  • year: Selected year.
  • rangeFrom: Selected month index range from.
  • rangeTo: Selected month index range to.
  • rangeFromMonth: Selected month from.
  • rangeToMonth: Selected to month.

Translations

Available languages

AbbrLanguage
afAfrikaans
arArabic
csCzech
daDanish
deGerman
elGreek
enEnglish
esSpanish
etEstonian
fiFinnish
frFrench
hiHindi
hrCroatian
huHungarian
idIndonesian
isIcelandic
itItalian
jaJapanese
kmKhmer
koKorean
kuKurdish
ltLithuanian
lvLatvian
msMalay
neNepali
nlDutch
noNorwegian
paPanjabi
plPolish
ptPortuguese
ruRussian
svSwedish
skSlovak
slSlovenian
soSomali
srSerbian
sqAlbanian
thThai
trTurkish
ukUkrainian
urUrdu
viVietnamese
yiYiddish
zhChinese
zuZulu

Simple Month Picker For Vue, vue-month-picker Plugin/Github


See Demo And Download

Official Website(kleinrein): Click Here

This superior jQuery/javascript plugin is developed by kleinrein. For extra Advanced Usages, please go to the official website.

Related Posts

HStack-and-VStack-in-CSS

CSS Layout Components Horizontal/Vertical Stack | HStack and VStack

HStack and VStack in CSS – CSS layout components that (basically) stack anything horizontally and vertically. A pure CSS library that makes it easy to stack elements…

Floating-Whatsapp-Chat-Button

How to Add Floating Whatsapp Chat Button In HTML | venom-button

Venom Button is a very simple plugin for the jQuery floating WhatsApp button. Adds a floating button to your site that calls WhatsApp Click to Chat API. It will automatically start the WhatsApp…

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…

alert-confirm-prompt-attention-js

Simple Alert, Confirm, Prompt Popup Using Vanilla JavaScript Library | attention.js

JavaScript provides various built-in functionality to display popup messages for different purposes. Attention JS is a vanillaJS plugin used to create a custom alert, confirm, or Prompt…

Bootstrap-4-Sidebar-Menu-Responsive-Template

Bootstrap 4 Sidebar Menu Responsive Template | MDB

Bootstrap Side Navbar – Responsive sidebar template based on the Bootstrap 4 framework. An easy-to-use, totally responsive, Google Material Design impressed aspect navigation for modern web app…

Bootstrap-4-Toast-Notification-Plugin

Lightweight Bootstrap 4 Toast Notification Plugin | BS4 Advanced Toast

A lightweight Bootstrap 4 Toast Notification plugin integrated with JS/jQuery. bs4-toast.js is a JavaScript library that enhances the native Bootstrap toast component with icons, buttons, callbacks, and…

Leave a Reply

Your email address will not be published. Required fields are marked *