Johan
Johan

Reputation: 211

Dates get colored in firefox not in ie

is there an alternative for elem.style.color because it doesnt render a different color in IE, only in firefox and in other browsers the code renders...

js fiddle works in firefox, not in IE

Upvotes: 0

Views: 42

Answers (2)

user1636522
user1636522

Reputation:

This has nothing to do with styles, diffInDays returns NaN which is not comparable.

NaN < 0  -> false
NaN > 0  -> false
NaN == 0 -> false

Upvotes: 0

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324650

        var dateArray = dateElement.split("-");
        var prevTime = new Date(dateArray);

Since you have dates already in the standard format (YYYY-MM-DD), just pass it in.

prevTime = new Date(dateElement);

Upvotes: 1

Related Questions