From 293bdc3b3d819f85dc16ee9d7f47a5ee0ea5fd23 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 29 Apr 2019 16:49:40 +0300 Subject: [PATCH] Fixed #856 - Calendar view="month" does not allow typing --- src/components/calendar/Calendar.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/calendar/Calendar.js b/src/components/calendar/Calendar.js index 90bb06a6d8..b0c1d5fbe0 100644 --- a/src/components/calendar/Calendar.js +++ b/src/components/calendar/Calendar.js @@ -1067,7 +1067,7 @@ export class Calendar extends Component { isMonthSelected(month) { const viewDate = this.getViewDate(); - if(this.props.value) + if(this.props.value && this.props.value instanceof Date) return this.props.value.getDate() === 1 && this.props.value.getMonth() === month && this.props.value.getFullYear() === viewDate.getFullYear(); else return false; @@ -1459,6 +1459,10 @@ export class Calendar extends Component { iValue++; }; + if (this.props.view === 'month') { + day = 1; + } + for (iFormat = 0; iFormat < format.length; iFormat++) { if(literal) { if(format.charAt(iFormat) === "'" && !lookAhead("'")) {