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

Invalid date when not debugging #233

Closed
ghost opened this issue Apr 7, 2018 · 1 comment
Closed

Invalid date when not debugging #233

ghost opened this issue Apr 7, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 7, 2018

Issue

When I change the date when Remote debugging is turned off, I get an invalid date from my code. However, when remote debugging is on, I get a valid date and it works fine. I'm Extremely confused.

Expected Behavior

Changing the date changes it without error.

Code

//model starts off with new Date()
//document_data = {current_time: new Date()}
let model = this.state.document_data['current_time'];

<DatePicker date={model} mode="datetime" format="YYYY-MM-DD hh:mm" confirmBtnText="Confirm" cancelBtnText="Cancel" showIcon={false} 
               
    onDateChange={(data) => { 
      console.log(new Date(data));
      document_data["current_time"] = new Date(data); 
      this.setState({document_data: document_data}); 
    }} />
  

Environment

  1. react-native -v: react-native-cli: 2.0.1
  2. node -v: v9.10.0
  3. npm -v: 5.6.0
  4. target platform: Android | iOS (BOTH but issue is in iOS)
  5. operating system: Mac OSX 10.13.3
@ghost
Copy link
Author

ghost commented Apr 8, 2018

This has to do with Chrome debugger being able to parse the date and the simulator not being able to. Found the answer here and you can look at the stack overflow post that is listed for more information:

https://github.com/xgfe/react-native-datepicker/issues/26

@ghost ghost closed this as completed Apr 8, 2018
This issue was closed.
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

0 participants