Moment JS

Example of parsing and formatting a Date with Moment JS.

by HemalathaThanigaivel

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>

JavaScript

var compareDate = moment("13/01/2013", "DD/MM/YYYY");
var startDate   = moment("12/01/2013", "DD/MM/YYYY");
var endDate     = moment("15/01/2013", "DD/MM/YYYY");

let info = compareDate.isBetween(startDate, endDate, 'days', '[]')
console.log(info)