Skip to content

Instantly share code, notes, and snippets.

hamswaldenkv / GetWeeksInMonth.js
Created Aug 29, 2020 — forked from markthiessen/getWeeksInMonth.js
JavaScript - get weeks in a month as array of start and end days
View GetWeeksInMonth.js
//note: month is 0 based, just like Dates in js
function getWeeksInMonth(month, year){
var weeks=[],
firstDate=new Date(year, month, 1),
lastDate=new Date(year, month+1, 0),
numDays= lastDate.getDate();
var start=1;
var end=7-firstDate.getDay();
hamswaldenkv / index.html
Created Oct 6, 2018
Simple react popup example
View index.html
<div id="content"></div>