Skip to content

Commit

Permalink
additional adjustment to computeMillisInCurrentDay - return 0 for 864…
Browse files Browse the repository at this point in the history
…e5 (midnight)
  • Loading branch information
jebeck committed Aug 11, 2015
1 parent 3195125 commit 66d3671
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/carelink/carelinkSimulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ function computeMillisInCurrentDay(e){
// matches a schedule, so we round to the nearest fifteen mins
// to increase the chance of matching up with a schedule
if (e.conversionOffset && e.conversionOffset !== 0) {
return Math.round(msFromMidnight/fifteenMinsInMs)*fifteenMinsInMs;
var result = Math.round(msFromMidnight/fifteenMinsInMs)*fifteenMinsInMs;
return result === 864e5 ? 0 : result;
}
return msFromMidnight;
}
Expand Down

0 comments on commit 66d3671

Please sign in to comment.