Skip to content

Commit

Permalink
Fix DateInput throws error on null dates. Fixes palantir#322
Browse files Browse the repository at this point in the history
  • Loading branch information
mfedderly committed Dec 6, 2016
1 parent 5e57a5e commit 76a1ee7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/datetime/src/dateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ export class DateInput extends AbstractComponent<IDateInputProps, IDateInputStat
* This is a no-op unless moment-timezone's setDefault has been called.
*/
private fromDateToMoment = (date: Date) => {
if (null == date) {
return moment(null);
}

return moment([
date.getFullYear(),
date.getMonth(),
Expand Down

0 comments on commit 76a1ee7

Please sign in to comment.