From 6f3597a50c122ff674b8ae017dd4634394ed124d Mon Sep 17 00:00:00 2001 From: akhil-geekyants Date: Tue, 19 Jun 2018 13:07:49 +0530 Subject: [PATCH] Added onDateChange callback support for datePicker android. --- src/basic/DatePicker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/basic/DatePicker.js b/src/basic/DatePicker.js index 4962f3ee6..e0971a1e1 100644 --- a/src/basic/DatePicker.js +++ b/src/basic/DatePicker.js @@ -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);