calendar-month-array
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -43,4 +43,5 @@ /** | ||
var formatSiblingMonthDate = opts.formatSiblingMonthDate || formatDate | ||
var day = 1 - (7 + first.getDay() - weekStartDay) % 7 | ||
var weeks = Math.ceil((last.getDate() - day) / 7) | ||
var firstDaysToComplete = (7 + first.getDay() - weekStartDay) % 7 | ||
var day = 1 - firstDaysToComplete | ||
var weeks = Math.ceil((last.getDate() + firstDaysToComplete) / 7) | ||
var lines = [] | ||
@@ -47,0 +48,0 @@ var headers = [] |
{ | ||
"name": "calendar-month-array", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Generates a calendar array with the days of a single month organized by week", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,3 +21,3 @@ var calendar = require('../') | ||
var expectedCell = 0 | ||
var expectedRow = 1 // as there is a day before, it comes in second row | ||
var expectedRow = 1 // as there is a day before, it comes in second row | ||
var cal = calendar(calendarDate, { weekStartDay: startDay }) | ||
@@ -30,2 +30,10 @@ t.equal(cal[0][0].getDay(), startDay) | ||
test('calendar take into account weekStartDay for weeks row', function (t) { | ||
var startDay = 1 | ||
var expectedRows = 6 | ||
var cal = calendar(new Date(2017, 9), { weekStartDay: startDay }) | ||
t.equal(cal.length, expectedRows) | ||
t.end() | ||
}) | ||
test('calendar last cell contains next month (sometimes)', function (t) { | ||
@@ -32,0 +40,0 @@ var expectedDay = new Date('1995-02-04 00:00:00') |
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
11916
9
198