title: How to make Gregorian and Islamic calendar in one (javascript)
body: <p>I am trying to make calendar which contain both Gregorian and Islamic date in one,I just rough coded Gregorian calendar like bellow but i don't have idea that how to include Islamic date with this,could any one please give me idea that how to make this</p>
  
  <p>I want to make calendar like this
  <a href="http://www.islamicfinder.org/Hcal/index.php" rel="nofollow">http://www.islamicfinder.org/Hcal/index.php</a></p>
  
  <p>my code is :</p>
  
  <pre><code>function Calendar()
  {
      var now=new Date();
      //---------------current date and time------------------
      var day=now.getDate();
      var month=now.getMonth()+1;
      var year=now.getFullYear();
      //-----------------------------------------------------
  
      var FirstDay=new Date(now.getFullYear(),now.getMonth(),1);
      var dayOne=FirstDay.getDay();
      var LastDay=new Date(now.getFullYear(),now.getMonth()+1,0);
      var dayLast=LastDay.getDay();
      var noDays=getMonthDays(year,month);
  
      var abs="&lt;table&gt;&lt;tr&gt;&lt;td&gt;sun&lt;/td&gt;&lt;td&gt;Mon&lt;/td&gt;&lt;td&gt;Tue&lt;/td&gt;&lt;td&gt;Wed&lt;/td&gt;&lt;td&gt;Th&lt;/td&gt;&lt;td&gt;Fri&lt;/td&gt;&lt;td&gt;sat&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;";
      var iterator=0;;
      while(dayOne&gt;0)
      {
          abs +="&lt;td&gt;&lt;/td&gt;"
          iterator++;
          dayOne--;
      }
      var i=1;
      alert(month);
      alert(year)
      while(i&lt;=noDays)
      {
          if(iterator&gt;6)
          {
              iterator=0;
              abs +="&lt;/tr&gt;&lt;tr&gt;"
          }
          abs +="&lt;td&gt;"+i+"&lt;/td&gt;";
          iterator++
          i++;
      }
      var nameOfMonth=monthName(month);
      document.getElementById("head").innerHTML="&lt;h1&gt;"+nameOfMonth+"&lt;/h1&gt;";
      document.getElementById("tble").innerHTML=abs;
  }
  function getMonthDays(iyear,imonth)
  {
      if (((iyear % 4)==0) &amp;&amp; ((iyear % 100)!=0) || ((iyear % 400)==0))
      {
          var days=new Array(0,31,29,31,30,31,30,31,31,30,31,30,31);
          return days[imonth];
      }
      else
      {
          var days=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
          return days[imonth];
      }
  
  }
  function monthName(m)
  {
      var months=new Array("nill","January","February","March","April","May","June","July","August","September","October","November","December");
      //alert(months[m]);
      return months[m];
  }
  </code></pre>