Skip to content

Commit 4adfb23

Browse files
committed
Fix startingDate to accept non-Moment dates (#186).
1 parent 128824c commit 4adfb23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/CalendarStrip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ class CalendarStrip extends Component {
186186

187187
//Function that checks if the locale is passed to the component and sets it to the passed date
188188
setLocale = date => {
189-
let _date = date;
190-
if (this.props.locale && date) {
191-
_date = moment(date).locale(this.props.locale.name);
189+
let _date = date && moment(date);
190+
if (this.props.locale && _date) {
191+
_date = _date.locale(this.props.locale.name);
192192
}
193193
return _date;
194194
}

0 commit comments

Comments
 (0)