react-native-date-picker icon indicating copy to clipboard operation
react-native-date-picker copied to clipboard

[android][new_arch][fix]: pass timestamp string instead of iso string…

Open badrey opened this issue 1 year ago • 1 comments

A workaround for runtime error with new architecture enabled on Android https://github.com/henninghall/react-native-date-picker/issues/840

badrey avatar Aug 14 '24 11:08 badrey

Please provide example code where this issue is reproducible and I'll look into it

henninghall avatar Aug 25 '24 16:08 henninghall

This solution helped me to fix crashes on Android with the new architecture. Can it be integrated in the next release?

RamProg avatar Nov 13 '24 09:11 RamProg

@henninghall this PR those indeed fix the crash that occur on Android on the new arch should also be tested on a non-new arch app to see if its brake anything.

mateoabrbt avatar Dec 09 '24 22:12 mateoabrbt

@henninghall A working exemple in my app :

import DatePicker from "react-native-date-picker";

const Select = () => {
    const [date, setDate] = useState(new Date());

    return <DatePicker date={date} onDateChange={setDate} />;
};

NonozgYtb avatar Dec 27 '24 22:12 NonozgYtb

@henninghall can you please explain little bit more on how to use your solution

rak-dev avatar Jan 20 '25 04:01 rak-dev

@henninghall

"react-native-date-picker": "5.0.8" "expo": "52.0.11"

if we set DatePicker prop modal to false it will error on android like this: Screenshot 2568-01-21 at 19 49 58

example code:

        <DatePicker
          modal={false}
          mode="datetime"
          open={open}
          date={new Date("2025-01-01")}
          onConfirm={(date) => {
            setOpen(false);
            setDate(date);
          }}
          onDateChange={(date) => {
            console.log("date: ", date);
            setDate(date);
          }}
          onCancel={() => {
            setOpen(false);
          }}
        />

this solution proved. it's work: Screenshot 2568-01-21 at 19 53 48

tarzui avatar Jan 21 '25 12:01 tarzui

i am still having this issue using "react-native-date-picker": "git+https://github.com/badrey/react-native-date-picker.git#new-arc-fix". exact same error on Android please help. !

29er avatar Jan 22 '25 22:01 29er