Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bnv1223 opened this issue Jul 10, 2024 · 24 comments

Comments

@bnv1223
Copy link

bnv1223 commented Jul 10, 2024

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",

@badrey
Copy link

badrey commented Aug 14, 2024

I made a fix which works for me. Had the same issue with new architecture enabled on Android
#848

@henninghall
Copy link
Owner

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

@pasindupansiluvault
Copy link

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

@brentkelly
Copy link

@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",

@shel404
Copy link

shel404 commented Oct 15, 2024

Facing the same issue while using inline mode with newArchEnabled

@szarbartosz
Copy link

szarbartosz commented Oct 24, 2024

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)

@SzymonGonet
Copy link

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

@mateoabrbt
Copy link

Same issue ! @henninghall

@lpcapestanya
Copy link

same issue here, is there any solution ?

@swoo888
Copy link

swoo888 commented Oct 31, 2024

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"

@henninghall
Copy link
Owner

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

@mateoabrbt
Copy link

Hello for me it was French !

@brentkelly
Copy link

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.

@RamProg
Copy link

RamProg commented Nov 13, 2024

Same error here! (also french)

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

@agag4
Copy link

agag4 commented Nov 13, 2024

i have same issue, is there any solution ??

@luisnquin
Copy link

Same here

@OldsunFlush
Copy link

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

@adblanc
Copy link

adblanc commented Nov 30, 2024

@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 👍

@ilteoood
Copy link

ilteoood commented Dec 2, 2024

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.

@henninghall
Copy link
Owner

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!

@OldsunFlush
Copy link

Indeed, it seems to works after a rebuild!

@sabinayakc
Copy link

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

@cebrakadabra
Copy link

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 ...

@baicuhaha
Copy link

baicuhaha commented Dec 20, 2024

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());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests