calendar-month
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -25,3 +25,3 @@ { | ||
], | ||
"version": "0.0.4" | ||
"version": "0.0.5" | ||
} |
@@ -25,4 +25,8 @@ | ||
} | ||
prevMonthDays = new Date(year, month - 1, 0).getDate() - meta.startDay; | ||
var previousMonth = new Date(year, month - 1, 0), | ||
nextMonth = new Date(year, month + 1, 0); | ||
prevMonthDays = previousMonth.getDate() - meta.startDay; | ||
var count = 0; | ||
@@ -32,9 +36,15 @@ for(var i = 0; i < 42; i++) { | ||
if(i < meta.startDay) { | ||
day.date = (prevMonthDays = prevMonthDays + 1); | ||
day.date = ++prevMonthDays; | ||
day.previous = true; | ||
day.month = previousMonth.getMonth(); | ||
day.year = previousMonth.getFullYear(); | ||
} else if(i > meta.lastDay + (meta.startDay - 1)) { | ||
day.date = (count = count + 1); | ||
day.date = ++count; | ||
day.next = true; | ||
day.month = nextMonth.getMonth(); | ||
day.year = nextMonth.getFullYear(); | ||
} else { | ||
day.date = (i - meta.startDay) + 1; | ||
day.month = date.getMonth(); | ||
day.year = date.getFullYear(); | ||
} | ||
@@ -65,3 +75,3 @@ m.list[m.list.length] = day; | ||
this.month = month; | ||
monthInformation(this.year, this.month, this); | ||
monthInformation(this.year, month + 1, this); | ||
} | ||
@@ -68,0 +78,0 @@ |
{ | ||
"name": "calendar-month", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "vanillajs month data handler", | ||
@@ -5,0 +5,0 @@ "main": "lib/month.js", |
calendar-month | ||
============== | ||
[![](https://img.shields.io/npm/v/calendar-month.svg)](https://www.npmjs.com/package/calendar-month) [![](https://img.shields.io/bower/v/calendar-month.svg)](http://bower.io/search/?q=calendar-month) | ||
> node | ||
@@ -25,3 +25,4 @@ | ||
console.log( new Month(2016, 3) ); | ||
// months from 0 (january) ... to 11 (december) | ||
new Month(2016, 3); | ||
``` | ||
@@ -32,3 +33,3 @@ | ||
``` js | ||
{ | ||
Month { | ||
year: 2016, | ||
@@ -35,0 +36,0 @@ month: 3, |
@@ -6,2 +6,3 @@ | ||
console.log( new Month(2016, 3) ); | ||
// months from 0 (january) ... to 11 (december) | ||
console.log( new Month(2016, 2) ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6610
139
87