Q: How to parse JS Date to specific format with moment.js I reading moment.js docs but can not find answer on my issue. 
I want to convert JS format date (ISO-8601) to specific format like 'YYYY-MM-DD hh:mm' 
I try something like this but it didn't work :
var date = new Date();
var dateMoment = moment(date, 'YYYY-MM-DD hh:mm');
console.log(dateMoment);

I can also reveice this in just string, but I don't want to convert it like this:
date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay() + ' ' + date.getHours() + ':' + date.getMinutes()

A: Have you tried the Moment.format() ?
Would be
var date = new Date();
var dateMoment = moment(date).format("YYYY-MM-DD hh:mm");
console.log(dateMoment);

in your case

A: You need to call the format function as follow:
moment(date).format('YYYY-MM-DD hh:mm')



var date = new Date();
var dateMoment = moment(date).format('YYYY-MM-DD hh:mm');
console.log(dateMoment);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script>


Resources

*

*Moment.js 2.20.1

A: Use below snippet
var date = new Date();
var dateMoment = moment(new Date()).format( 'YYYY-MM-DD hh:mm');
console.log(dateMoment);

Check in detail docs here

A: Use format
moment(date).format('YYYY-MM-DD hh:mm');

