v1
- by inphinitphp 8/5/202000
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
var weekday = 0, month = 0, year = 2020;
delete caserun single casemove downdrag and drop case


ready



// Obtem o ultimo dia do mês
var daysInMonth = new Date(year, month + 1, 0).getDate();

// Obtem primeiro dia da semana do mês
var firstWeekDay = new Date(year, month, 1).getDay();

Math.floor((daysInMonth + (weekday + firstWeekDay) % 7) / 7);
delete caserun single casemove upmove downdrag and drop case


ready



var count = 0,
    date = new Date(year, month, 1, 0, 0, 0);

while (month === date.getMonth()) {
    if (date.getDay() === weekday) count++;

    date.setDate(date.getDate() + 1);
}
delete caserun single casemove updrag and drop case


ready



var count = 0,
    increment = 1,
    date = new Date(year, month, 1, 0, 0, 0);

while (month === date.getMonth()) {
    if (date.getDay() === weekday) {
        count++;
        increment = 7;
    }

    date.setDate(date.getDate() + increment);
}
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN