henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.21k stars 338 forks source link

AM/ PM not changing on onConfirm method. #845

Closed Shweta-UMR closed 1 month ago

Shweta-UMR commented 1 month ago

I am using this to pick a time in the app, but when I only change the AM to PM or vice versa, the time doesn't update correctly.

<DatePicker modal open={open} date={time} mode={mode} androidVariant="nativeAndroid" is24hourSource="locale" onConfirm={selectedTime => { const newTime = new Date(selectedTime); // Force selection to a new Date instance console.log('🚀 ~ newTime:', newTime); setTime(newTime); }} onCancel={() => setOpen(false)} locale="en" />



**Smartphone (please complete the following information):**
 - OS: [Android]
 - React Native version [e.g. 0.72.4]
 - react-native-date-picker version [e.g. 5.0.2]
henninghall commented 1 month ago

Incomplete example - closing