diff --git a/README.md b/README.md index 5d51f0c..d7cb003 100644 --- a/README.md +++ b/README.md @@ -92,20 +92,21 @@ _The MonthPicker and the MonthPickerInput shares the same props and events._ ### Props -| Prop | Type | Default | Description | -| ------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------- | -| lang | String | en | The language of the months. | -| months | Array | [] | Custom months if language is unsupported. | -| default-month | Integer | | The default selected month of the month picker. To show the month picker unselected, use the no-default prop. | -| default-year | Integer | | The default year of the month picker. | -| no-default | Boolean | false | Show the month picker unselected. | -| show-year | Boolean | false | Show the year picker. | -| editable-year | Boolean | false | Year appears as a input field. | -| clearable | Boolean | false | Possible to clear the chosen month. | -| variant | String | default | Color variant. Currently supports default and dark. | -| year-only | Boolean | false | Hide the months so it acts as a pure year picker | -| max-date | Date | null | Set a max date. Higher dates will be disabled. | -| min-date | Date | null | Set a mih date. Higher dates will be disabled. | +| Prop | Type | Default | Description | +| ---------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------- | +| lang | String | en | The language of the months. | +| months | Array | [] | Custom months if language is unsupported. | +| default-month | Integer | | The default selected month of the month picker. To show the month picker unselected, use the no-default prop. | +| default-year | Integer | | The default year of the month picker. | +| no-default | Boolean | false | Show the month picker unselected. | +| show-year | Boolean | false | Show the year picker. | +| editable-year | Boolean | false | Year appears as a input field. | +| clearable | Boolean | false | Possible to clear the chosen month. | +| variant | String | default | Color variant. Currently supports default and dark. | +| year-only | Boolean | false | Hide the months so it acts as a pure year picker | +| max-date | Date | null | Set a max date. Higher dates will be disabled. | +| min-date | Date | null | Set a mih date. Higher dates will be disabled. | +| input-pre-filled | Boolean | false | Only applies for ``. Input will be pre filled if default-year and default-month is set. | ### Events diff --git a/example/App.vue b/example/App.vue index 277c76b..8f4c80c 100644 --- a/example/App.vue +++ b/example/App.vue @@ -147,7 +147,9 @@ :max-date="maxDate !== null ? new Date(maxDate) : null" :min-date="minDate !== null ? new Date(minDate) : null" :year-only="isYearOnly" - :no-default="true" + :default-month="8" + :default-year="2020" + :input-pre-filled="true" @change="showDate" /> diff --git a/package.json b/package.json index ba82347..ba72de9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-month-picker", - "version": "1.3.1", + "version": "1.3.2", "main": "src/index.js", "description": "A simple and elegant month picker for Vue", "scripts": { @@ -19,7 +19,10 @@ "email": "rein@live.no", "url": "https://www.andreasrein.net/" }, - "repository": "github:kleinrein:vue-month-picker", + "repository": { + "type": "git", + "url": "git+https://github.com/kleinrein/vue-month-picker.git" + }, "license": "MIT", "devDependencies": { "eslint": "^7.7.0", diff --git a/src/MonthPickerInput.vue b/src/MonthPickerInput.vue index e8d7d2a..5c6e725 100644 --- a/src/MonthPickerInput.vue +++ b/src/MonthPickerInput.vue @@ -70,7 +70,7 @@ export default { }, mounted() { if (this.inputPreFilled && this.defaultMonth !== null && this.defaultYear !== null) { - this.selectedDate = `${this.monthsByLang[this.defaultMonth]}, ${this.defaultYear}` + this.selectedDate = `${this.monthsByLang[this.defaultMonth - 1]}, ${this.defaultYear}` } }, methods: {