Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check a date is between two dates in javascript

const dateCheck = (from, to, check) => {
    let fDate,lDate,cDate;
    fDate = Date.parse(from);
    lDate = Date.parse(to);
    cDate = Date.parse(check);
    if((cDate <= lDate && cDate >= fDate))  return true
    return false;
}
dateCheck("02/05/2021","02/09/2021","02/07/2021")
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #check #date #dates #javascript
ADD COMMENT
Topic
Name
9+4 =