Answer the question
In order to leave comments, you need to log in
How to format date using moment?
It is React that interests me and the main difficulty lies in the fact that there is a result of two dates:
experience is an object that stores dates
{moment(experience.end_date).diff(experience.start_date, 'days')}
Answer the question
In order to leave comments, you need to log in
At the moment, I know that you can output data in the format of either only the year, or only the months, or only the days.You can output in any format that moment.js understands. Everything your heart desires is there: https://momentjs.com/docs/#/displaying/format/.
Depending on the number of days.https://momentjs.com/docs/#/displaying/difference/
Is there a method that does this?No, but there are conditional statements in javascript. You need one like this:
if () {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question