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

Date constructor behaves differently in debug mode #13195

Closed
ghost opened this issue Mar 29, 2017 · 2 comments
Closed

Date constructor behaves differently in debug mode #13195

ghost opened this issue Mar 29, 2017 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ghost
Copy link

ghost commented Mar 29, 2017

I've tried to create dates from string using new Date() constructor and it behaves differently in debug mode than in standard mode. For example, in debug mode I can create a date using
const date = new Date("2017-10-09 12:00:00")

In standard mode (without debug js remotely) I get Invalid Date in my const.

Looks like the constructor accepts more formats in debug.

@filiphosko
Copy link

Hi, by debug mode you probably mean remote debugging in Chrome? There are differences between the JS engines that are used by the simulator/device (JavaScriptCore) and by Chrome (V8). You can check the answer in this StackOverflow question. Another thing that I noticed is that you have one extra single quote there which would cause a syntax error:

const date = new Date("2017-10-09 12:00:00"'); // single quote after a closing double quote

@filiphosko
Copy link

filiphosko commented Mar 29, 2017

@DEEvent If you are ok with the response and you are not considering leaving this issue open, we can close it.

@ghost ghost closed this as completed Mar 29, 2017
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants