53
rated 0 times
[
58]
[
5]
/ answers: 1 / hits: 33137
/ 10 Years ago, tue, january 13, 2015, 12:00:00
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
More From » date