0.1.1 • Published 9 years ago

square-month v0.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

SquareMonth

Build Status Dependencies

SquareMonth – simple library for getting all days in a squared month.

For example: if you want to display calendar like this:

September 2015

MonTueWenThuFriSatSun
31123456
78910111213
14151617181920
21222324252627
2829301234

You can use SquareMonth to get a list of all Date objects in in required month (including 31 Aug and 1-4 Oct).

Install

npm

npm install square-month --save

Import

// CommonJS on ES6 syntax
import SquareMonth from 'square-month';

// CommonJS on ES5 syntax
var SquareMonth = require('square-month');

// RequireJS or other AMD
define(['SquareMonth'], function(SquareMonth) {
    // ...
});

// Browser
var SquareMonth = window.SquareMonth;

Usage

var days = SquareMonth(2015, 8);

console.log(days.length);           // 35
console.log(days[0])                // Mon Aug 31 2015 00:00:00
console.log(days[days.length - 1]); // Sun Oct 04 2015 00:00:00
0.1.1

9 years ago

0.1.0

9 years ago