[Solved] Get Friday Dates of Year in javascript using jquery [closed]


Please look into the below code written in java script.

<!DOCTYPE html>
<html>
<body>
    <script>
        var x = new Date();
       //set the financial year starting date
        x.setFullYear(2013, 03, 01);

       //set the next financial year starting date
            var y = new Date();
        y.setFullYear(2014, 03, 01);
        var j = 1;
        var count = 0;

      //getting the all fridays in a financial year
        for ( var i = 0; x<y; i += j) {
            if (x.getDay() == 5) {
                document.write("Date : " + x.getDate() + "https://stackoverflow.com/"
                        + (x.getMonth() + 1) + "<br>");
                x = new Date(x.getTime() + (7 * 24 * 60 * 60 * 1000));
                j = 7;
                count++;
            } else {
                j = 1;
                x = new Date(x.getTime() + (24 * 60 * 60 * 1000));
            }
        }
        document.write("total fridays : " + count + "<br>");
    </script>
</body>
</html>

This returns the all fridays which in a financial year. You can modify this specific to your requirement.

1

solved Get Friday Dates of Year in javascript using jquery [closed]