SyntaxFix
Write A Post
Hire A Developer
Questions
I use moment along with new Date to handle cases of undefined data values:
undefined
const date = moment(new Date("2016-10-19"));
because of: moment(undefined).isValid() == true
moment(undefined).isValid() == true
where as the better way: moment(new Date(undefined)).isValid() == false
moment(new Date(undefined)).isValid() == false