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

Error: Exception in HostFunction: Non-whitespace character found after end of conversion: "-07-10T12:51:52.881Z"

Open bnv1223 opened this issue 1 year ago • 5 comments

Getting the error : Error: Exception in HostFunction: Non-whitespace character found after end of conversion: "-07-10T12:51:52.881Z"

"react": "18.2.0", "react-native": "0.74.1", "react-native-date-picker": "^5.0.4",

bnv1223 avatar Jul 10 '24 12:07 bnv1223

I made a fix which works for me. Had the same issue with new architecture enabled on Android https://github.com/henninghall/react-native-date-picker/pull/848

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

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

So the issue happens when using the component with modal={false} and newArchEnabled=true

pasindupansiluvault avatar Oct 01 '24 08:10 pasindupansiluvault

@henninghall this happens for me with just the default inline example:

import React, { useState } from 'react'
import DatePicker from 'react-native-date-picker'

export default () => {
  const [date, setDate] = useState(new Date())

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

New architecture enabled. Relevant packages:

"react": "18.2.0",
"react-native": "~0.75.0",
"react-native-date-picker": "^5.0.7",

brentkelly avatar Oct 14 '24 22:10 brentkelly

Facing the same issue while using inline mode with newArchEnabled

shel404 avatar Oct 15 '24 07:10 shel404

Having the same issue (new arch) - @henninghall are there any updates on this one? 🙏 (created dev builds with eas - the issue occurs only on android emulator - on ios it works fine)

szarbartosz avatar Oct 24 '24 20:10 szarbartosz

Same issue... @henninghall any updates on this one?

SzymonGonet avatar Oct 24 '24 21:10 SzymonGonet

Same issue ! @henninghall

mateoabrbt avatar Oct 27 '24 22:10 mateoabrbt

same issue here, is there any solution ?

lpcapestanya avatar Oct 28 '24 17:10 lpcapestanya

for people get stuck by this error, Badrey made a fix for this. see comments above. To use the fix, edit package.json dependency section to use this line below, and it will pull in Badrey's fix.
"react-native-date-picker": "git+https://github.com/badrey/react-native-date-picker.git#new-arc-fix"

swoo888 avatar Oct 31 '24 17:10 swoo888

Hi guys I’ll look into this, which device languages is active when this happens?

henninghall avatar Nov 10 '24 08:11 henninghall

Hello for me it was French !

mateoabrbt avatar Nov 10 '24 21:11 mateoabrbt

Hi guys I’ll look into this, which device languages is active when this happens?

@henninghall FYI for me it was just the default inline example in English.

brentkelly avatar Nov 10 '24 21:11 brentkelly

Same error here! (also french)

@badrey solution is working for me, @henninghall can we consider to integrate it to the next release? Thank you.

RamProg avatar Nov 13 '24 09:11 RamProg

i have same issue, is there any solution ??

agag4 avatar Nov 13 '24 16:11 agag4

Same here

luisnquin avatar Nov 18 '24 02:11 luisnquin

Same here. Even with the fix, the app crashes on date change.

pierreprezelin avatar Nov 19 '24 18:11 pierreprezelin

@OldsunFlush I had the same issue at first and it was because I forgot to rebuild the app, now it seems to works smoothly even on date change with the fix 👍

adblanc avatar Nov 30 '24 05:11 adblanc

I have the same issue and I confirm that patching the package using @badrey's PR worked on my app with the native architecture enabled.

ilteoood avatar Dec 02 '24 16:12 ilteoood

I have been able to reproduce this in new architecture (bridgeless) with expo 52.

I appreciate @badrey 's solution, but unfortunately it is not something we can merge at the moment.

I've made a draft PR of the approach we would need, if anyone got the time, please pick it up from there and complete it. Make it compile and test it out. I will have limited internet access until end of januari but I will be able to review and merge PRs.

Thanks guys!

henninghall avatar Dec 12 '24 23:12 henninghall

Indeed, it seems to works after a rebuild!

pierreprezelin avatar Dec 14 '24 00:12 pierreprezelin

Having the same issue. Currently using @badrey's solution until this gets fixed upstream.

sabinayakc avatar Dec 14 '24 18:12 sabinayakc

I applied it as a patch for now to fix it in the new architecture (RN0.76.3), (react-native-date-picker ^5.0.7). (only needed for android, as pointed out)

Step 1:

Edit the package as described in #848, paths:

./node_modules/react-native-date-picker/android/src/main/java/com/henninghall/date_picker/Utils.java
./node_modules/react-native-date-picker/src/DatePickerAndroid.js

Step 2:

Install patch-package

npm install patch-package -D 

or via yarn

yarn add patch-package postinstall-postinstall --dev

Step 3:

add the postinstall script in your package.json

"scripts": {
  "postinstall": "patch-package"
 }

Step 4:

Create the patch file

npx patch-package react-native-date-picker

or

yarn patch-package react-native-date-picker

Step 5:

This will produce a file in your ./patches directory

Step 6:

Apply the patch

npm install or yarn

Step 7:

Add your staged changes

git add .
git commit ...
git push origin ...

cebrakadabra avatar Dec 16 '24 02:12 cebrakadabra

I still have the same issue. Can the official release solve this problem? I'm just using it in a simple way. const [date, setDate] = useState(new Date()); <DatePicker date={date} onDateChange={setDate} />

baicuhaha avatar Dec 20 '24 08:12 baicuhaha

@henninghall I am facing the same error is there any there update regarding that or have to use @badrey 's solution ??

vishalkpiv avatar Jan 07 '25 09:01 vishalkpiv

Hi, I used the solution @badrey and it works

I used it this way https://github.com/henninghall/react-native-date-picker/issues/840#issuecomment-2450405601

When will the fix be included in the release?

wow64cpu avatar Jan 17 '25 11:01 wow64cpu

same issue here, is there any solution ?

UmarbekSaidov avatar Jan 18 '25 07:01 UmarbekSaidov

for people get stuck by this error, Badrey made a fix for this. see comments above. To use the fix, edit package.json dependency section to use this line below, and it will pull in Badrey's fix. "react-native-date-picker": "git+https://github.com/badrey/react-native-date-picker.git#new-arc-fix"

it worked, thank you

UmarbekSaidov avatar Jan 18 '25 07:01 UmarbekSaidov

The issue has been resolved in version 5.0.9. Please consider sponsoring the package to support this work 🩷

henninghall avatar Jan 26 '25 16:01 henninghall

@henninghall : We still see this issue in the latest version 5.0.10, would really appreciate if the changes are tested in Android device. I appreciate your hardwork and dedication in maintaining this library.

xshinigamiy avatar Mar 06 '25 19:03 xshinigamiy