0

I have some dates fetched from an API. However I would like to format them in a more presentable manner. They currently display like so 1972-08-24 however I would like to display them as YEAR,MONTH. How would I do this?

Current code: <p className='available'>Available: {movie.release_date}</p>

1

1 Answer 1

1

check out moment.js

var moment = require('moment');

var yourDate = new Date('1972-08-24')
var formattedDate = moment(yourDate).format('YYYY, MMMM');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.