Skip to content

Commit

Permalink
Fixed #856 - Calendar view="month" does not allow typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 29, 2019
1 parent c53b10a commit 293bdc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("'")) {
Expand Down

0 comments on commit 293bdc3

Please sign in to comment.