Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function monthWeeks(year, month) {
- var days = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'];
- var months = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'];
- var firstDay = new Date(year, month, 1);
- var totalDays = new Date(year, month, 0).getDate();
- var tueofMonth = 0
- for (var i = 1; i <= totalDays; i++) {
- var weekDay = new Date(year, month, i);
- //console.log("Día "+i+" de "+months[month]+" es: "+ days[weekDay.getDay()]);
- if (weekDay.getDay() == 2) {
- tueofMonth++;
- if (tueofMonth == 3) {
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement