From caf69e0d562c54779b7a4e890947977c5fed349c Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Thu, 16 May 2019 12:26:25 +0300 Subject: [PATCH] Imlemented Month/Year Picker --- src/components/calendar/Calendar.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index bcb19bbaa..d4959227a 100644 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -44,6 +44,11 @@ +
+ + {{m}} + +
@@ -336,6 +341,9 @@ export default { return false; } }, + isMonthSelected(month) { + return this.value ? (this.value.getMonth() === month && this.value.getFullYear() === this.currentYear) : false; + }, isDateEquals(value, dateMeta) { if (value) return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year; @@ -1097,6 +1105,9 @@ export default { if (this.timePickerTimer) { clearInterval(this.timePickerTimer); } + }, + onMonthSelect(index) { + this.onDateSelect({year: this.currentYear, month: index, day: 1, selectable: true}); } }, computed: { @@ -1287,6 +1298,14 @@ export default { } return yearOptions; + }, + monthPickerValues() { + let monthPickerValues = []; + for (let i = 0; i <= 11; i++) { + monthPickerValues.push(this.locale.monthNamesShort[i]); + } + + return monthPickerValues; } }, components: {