1// convert date format to "YYYY-MM-DD"
2var a = new Date().toJSON().slice(0, 10)
3// get date from input field, by default is "YYYY-MM-DD" format
4var b = document.getElementById('datePicker').value
5
6// compare
7console.log(a == b)
8console.log(a > b)
9console.log(a < b)