Skip to content

Commit

Permalink
Added onDateChange callback support for datePicker android.
Browse files Browse the repository at this point in the history
  • Loading branch information
akhil-ga committed Jun 19, 2018
1 parent a8235c5 commit 6f3597a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/basic/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class DatePicker extends React.Component {
});
const { action, year, month, day } = newDate;
if (action === "dateSetAction") {
this.setState({ chosenDate: new Date(year, month, day) });
let selectedDate = new Date(year, month, day);
this.setState({ chosenDate: selectedDate });
this.props.onDateChange(selectedDate);
}
} catch ({ code, message }) {
console.warn("Cannot open date picker", message);
Expand Down

0 comments on commit 6f3597a

Please sign in to comment.