Linked Questions

Popular Questions

How to fix moment.js in reactjs?

Asked by At

I am using moment.js and getting this error:

Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info. Arguments: [0] _isAMomentObject: true, _isUTC: false, _useU

In my react component I have:

const sortTasks = (first, second) => moment(first.endDate).diff(second.endDate);

The first.enddate=‘20 dec 2018’

How can I avoid this warning in the console?

Related Questions