JSFiddle - React, Tailwind, and code Playground
by Nibin George
HTML
http://pastebin.com/i17udxJD
JavaScript
<!DOCTYPE HTML>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
/*
var start = new Date('04-Sep-2013');
var end = new Date('10-Nov-2013');
var monthNames = [ "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" ];
var tmp = start;
var d;
var myDates=[];
//Sample array
var horseBreeds = ['Quarter Horse', 'Thoroughbred', 'Arabian'];
//Gets the corresponding week dates
while(end > tmp)
{
new_date = tmp.getDate()+7;
dates = tmp.setDate(new_date);
d = new Date(dates);
date = d.getDate();
month = d.getMonth();
year = d.getFullYear();
my_date = date+" "+monthNames[month]+" "+year;
myDates.push(my_date);
}
//Merge with the array list the new date list
var breeds = $.merge( horseBreeds, myDates);
//------------------------------------------------------------------------
//Exclude dates
arr = jQuery.grep(breeds, function( value, index ) {
return ( value!== "Quarter Horse" && value!== "Thoroughbred");
});
*/
//--------------------------------MONTH----------------------------------
//0 --january
//1 --february
var start_month =new Date('04-Sep-2013');;
var end_month = new Date('10-Nov-2013');
start_month_index= start_month.getMonth();
end_month_index= end_month.getMonth();
start_month_day= start_month.getDay();
end_month_day= end_month.getDay();
start_month_year= start_month.getFullYear();
end_month_year= end_month.getFullYear();
temp = start_month;
new_date = temp.getDay();
while(end_month > temp)
{
//alert(end_month);
//alert(temp);
dates = temp.setDate(new_date);
d = new Date(dates);
//alert(d);
monthStart = new Date(start_month_year, start_month_index, start_month_day);
monthEnd = new Date(start_month_year, start_month_index + 1, start_month_day);
monthLength = (monthEnd - monthStart) / (1000 * 60 * 60 * 24);
new_date = temp.getDate()+monthLength;
...