I am having a difficult time checking if one date is less than or equal to another.
Here is my code,
var bftStartDt = input1[0]; //This is a string with value "01-Jul-2007"
var bftEndDt = input1[4]; //This is a string with value "01-Jul-1942"
var strtDt = new Date(bftStartDt);
var endDt = new Date(bftEndDt);
var flag = 0; // false
if (endDt <= strtDt){
flag = 1; // true
}
It never enters the if statement when it should ? What am I missing here.
Thanks
var strtDt = new Date("2007-07-01");
var endDt = new Date("1942-07-01");
var flag = 0; // false
if (endDt <= strtDt){
flag = 1; // true
alert("true");
}
It works check out the plunker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With