📅  最后修改于: 2022-03-11 14:48:12.453000             🧑  作者: Mango
// convert date format to "YYYY-MM-DD"
var a = new Date().toJSON().slice(0, 10)
// get date from input field, by default is "YYYY-MM-DD" format
var b = document.getElementById('datePicker').value
// compare
console.log(a == b)
console.log(a > b)
console.log(a < b)