pagerduty-overlap-checker
Advanced tools
Comparing version 2.1.6 to 2.1.7
{ | ||
"name": "pagerduty-overlap-checker", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"description": "PagerDuty Overlap Duties Checker", | ||
@@ -11,3 +11,3 @@ "main": "src/", | ||
"test": "./node_modules/.bin/mocha", | ||
"lint": "conventional-changelog-lint --from=master && ./node_modules/eslint/bin/eslint.js ./src", | ||
"lint": "conventional-changelog-lint --from=master && ./node_modules/eslint/bin/eslint.js ./src ./test", | ||
"coverage": "./scripts/cov", | ||
@@ -14,0 +14,0 @@ "coveralls": "npm run coverage && cat ./cov.info | ./node_modules/coveralls/bin/coveralls.js", |
@@ -7,3 +7,3 @@ [![Build Status](https://travis-ci.org/apiaryio/pagerduty-overlap-checker.svg?branch=master)](https://travis-ci.org/apiaryio/pagerduty-overlap-checker) | ||
- 6.x (LTS) | ||
- 8.x (LTS) | ||
@@ -10,0 +10,0 @@ # Pager Duty Overlap Checker |
@@ -150,11 +150,15 @@ const async = require('async'); | ||
daysToAdd.forEach((dayToAdd) => { | ||
const start = moment.tz(dayToAdd, timezone).startOf('day'); | ||
let start = moment.tz(dayToAdd, timezone).startOf('day'); | ||
let end = moment.tz(dayToAdd, timezone).startOf('day'); | ||
if (item.start) { | ||
const startTime = item.start.split(':'); | ||
start.add({ hours: startTime[0], minutes: startTime[1] }); | ||
// we can't call moment.add({hours:number}) as this | ||
// would produce an off value for the DST switch day | ||
start = moment.tz(`${start.format('YYYY-MM-DD')} ${startTime[0]}:${startTime[1]}`, timezone); | ||
} | ||
if (item.end) { | ||
const endTime = item.end.split(':'); | ||
end.add({ hours: endTime[0], minutes: endTime[1] }); | ||
// we can't call moment.add({hours:number}) as this | ||
// would produce an off value for the DST switch day | ||
end = moment.tz(`${end.format('YYYY-MM-DD')} ${endTime[0]}:${endTime[1]}`, timezone); | ||
} else { | ||
@@ -161,0 +165,0 @@ end = end.endOf('day'); |
28310
518