From 8db4e4fc6308fd7276d2fc11a02a532500202488 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Thu, 16 May 2019 10:29:28 +0300 Subject: [PATCH] ButtonBar for Calendar --- src/components/calendar/Calendar.vue | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index dc4cec1a5..5986561ab 100644 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -43,6 +43,10 @@ +
+ + +
@@ -730,7 +734,6 @@ export default { } return output; }, - formatTime(date) { if (!date) { return ''; @@ -764,6 +767,27 @@ export default { } return output; + }, + onTodayButtonClick(event) { + let date = new Date(); + let dateMeta = { + day: date.getDate(), + month: date.getMonth(), + year: date.getFullYear(), + otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear, + today: true, + selectable: true + }; + + this.onDateSelect(dateMeta); + this.$emit('click-today', date); + this.onTodayClick.emit(event); + event.preventDefault(); + }, + onClearButtonClick(event) { + this.updateModel(null); + this.overlayVisible = false; + this.$emit('click-clear'); } }, computed: {