Skip to content

Commit

Permalink
Merge pull request GeekyAnts#2027 from GeekyAnts/enhan/datePicker/onD…
Browse files Browse the repository at this point in the history
…ateChangeAndroid

Added onDateChange callback support for datePicker android.
  • Loading branch information
SupriyaKalghatgi authored Jun 22, 2018
2 parents 0741235 + 6f3597a commit 0510cfe
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 0510cfe

Please sign in to comment.