SHARE
TWEET

Untitled

a guest Oct 16th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function monthWeeks(year, month) {
  2.  
  3.     var days = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'];
  4.     var months = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'];
  5.     var firstDay = new Date(year, month, 1);
  6.     var totalDays = new Date(year, month, 0).getDate();
  7.     var tueofMonth = 0
  8.     for (var i = 1; i <= totalDays; i++) {
  9.         var weekDay = new Date(year, month, i);
  10.         //console.log("Día "+i+" de "+months[month]+" es: "+ days[weekDay.getDay()]);
  11.         if (weekDay.getDay() == 2) {
  12.             tueofMonth++;
  13.             if (tueofMonth == 3) {
  14.                 break;
  15.             }
  16.         }
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top