Answers for "check if a date is before another date in typescript"

1

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)
Posted by: Guest on May-08-2021

Code answers related to "check if a date is before another date in typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language