Skip to content

Commit

Permalink
update hours-in-range calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate-Wessel committed Nov 27, 2024
1 parent 65df2ef commit fc52e75
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/timeRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ export class TimeRange extends Factor {
}
get hoursInRange(){ // how many hours are in the timeRange?
if(! this.isComplete){ return undefined }
return this.endHour - this.startHour
if(this.endHour > this.startHour){
return this.endHour - this.startHour
} else {
console.log(this.endHour,this.startHour, 24 - this.startHour + this.endHour)
return 24 - this.startHour + this.endHour
}
}
}

Expand Down

0 comments on commit fc52e75

Please sign in to comment.