You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I was using moment in my project. I wanted to use a if-condition that will execute a peice of code based on a condition that If the date string that I am getting is a valid date string then only it will proceed else it won't. But somehow the date string was coming undefined. Surprisingly, moment(undefined).isValid() was returning true. It should return false
To Reproduce
Steps to reproduce the behavior:
Just code this line : console.log(moment(undefined).isValid()); //output TRUE
Expected behavior
Output should be false.
Desktop (please complete the following information):
OS: ubuntu
Browser firefox
Moment-specific environment
The time zone setting of the machine the code is running on
The time and date at which the code was run
Other libraries in use (TypeScript, Immutable.js, etc)
Please run the following code in your environment and include the output:
Describe the bug
I was using moment in my project. I wanted to use a if-condition that will execute a peice of code based on a condition that If the date string that I am getting is a valid date string then only it will proceed else it won't. But somehow the date string was coming undefined. Surprisingly, moment(undefined).isValid() was returning true. It should return false
To Reproduce
Steps to reproduce the behavior:
Just code this line : console.log(moment(undefined).isValid()); //output TRUE
Expected behavior
Output should be false.
Desktop (please complete the following information):
Moment-specific environment
Please run the following code in your environment and include the output:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: