Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
niladic committed Oct 11, 2023
1 parent 8c33b03 commit ffb8824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/controllers/ApplicationController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import cats.syntax.all._
import constants.Constants
import forms.FormsPlusMap
import helper.BooleanHelper.not
import helper.BusinessDaysCalculator
import helper.CSVUtil.escape
import helper.PlayFormHelper.formErrorsLog
import helper.ScalatagsHelpers.writeableOf_Modifier
import helper.StringHelper.{CanonizeString, NonEmptyTrimmedString}
import helper.Time.zonedDateTimeOrdering
import helper.{Hash, Time, UUIDHelper}
import helper.{BusinessDaysCalculator, Hash, Time, UUIDHelper}
import helper.TwirlImports.toHtml
import models.Answer.AnswerType
import models.EventType._
Expand Down
3 changes: 3 additions & 0 deletions app/helper/BusinessDaysCalculator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ object BusinessDaysCalculator {
val (start, end) =
if (endTime.isAfter(startTime)) (startTime, endTime) else (endTime, startTime)

// scalastyle:ignore var.local
var totalHours: Int = 0

if (start.truncatedTo(ChronoUnit.DAYS).isEqual(end.truncatedTo(ChronoUnit.DAYS))) {
if (isBusinessDay(start)) {
totalHours = end.getHour - start.getHour
}
} else {
// scalastyle:ignore var.local
var current = start.truncatedTo(ChronoUnit.DAYS)
// scalastyle:ignore while
while (!current.isAfter(end)) {
if (isBusinessDay(current)) {
if (current.isEqual(start.truncatedTo(ChronoUnit.DAYS))) {
Expand Down

0 comments on commit ffb8824

Please sign in to comment.