check if a date is before another date in typescript
// 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)