Skip to content

Commit 01df866

Browse files
authored
Merge pull request #74 from oliveroneill/datetime_bug_fix
Fix typo that causes hour to be unset in Android datetime picker
2 parents 7140240 + daac6ed commit 01df866

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CustomDatePickerAndroid/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export default class CustomDatePickerAndroid extends Component {
5151
// Prepopulate and show time picker
5252
const timeOptions = {is24Hour: this.props.is24Hour};
5353
if (this.props.date) {
54-
timeOptions.hours = this.props.date.getHours();
55-
timeOptions.minute = this.props.date.getMinutes();
54+
timeOptions.hour = moment(this.props.date).hour();
55+
timeOptions.minute = moment(this.props.date).minute();
5656
}
5757
const { action: timeAction, hour, minute } = await TimePickerAndroid.open(timeOptions);
5858
if (timeAction !== TimePickerAndroid.dismissedAction) {

0 commit comments

Comments
 (0)