Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #date #date #typescript
ADD COMMENT
Topic
Name
7+9 =