Showing posts with label How to Compare Two Dates using JQuery. Show all posts
Showing posts with label How to Compare Two Dates using JQuery. Show all posts

Wednesday, December 28, 2016

How to Compare Two Dates using JQuery.

How to Compare Two Dates using JQuery ?


function compareTwoDates(Date1, Date2) {
    var D1 = Date1.split(".");
    var bool = false;
    D1 = new Date(D1.pop(), D1.pop() - 1, D1.pop());
    var D2 = Date2.split(".");
    D2 = new Date(D2.pop(), D2.pop() - 1, D2.pop());
    if (D1 >= D2)
        bool = true;
    return bool;
}