Skip to content

Commit

Permalink
fix: [ANDROAPP-5800] lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Mar 7, 2024
1 parent b4accbd commit d2d6455
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,16 @@ fun monthsBetween(startDate: Date?, endDate: Date?): Int {
require(!(startDate == null || endDate == null)) { "Both startDate and endDate must be provided" }
val startCalendar = Calendar.getInstance()
startCalendar.time = startDate
val startDateTotalMonths = (12 * startCalendar[Calendar.YEAR]
+ startCalendar[Calendar.MONTH])
val startDateTotalMonths = (
12 * startCalendar[Calendar.YEAR] +
startCalendar[Calendar.MONTH]
)
val endCalendar = Calendar.getInstance()
endCalendar.time = endDate
val endDateTotalMonths = (12 * endCalendar[Calendar.YEAR]
+ endCalendar[Calendar.MONTH])
val endDateTotalMonths = (
12 * endCalendar[Calendar.YEAR] +
endCalendar[Calendar.MONTH]
)
return endDateTotalMonths - startDateTotalMonths
}
private const val UI_FORMAT = "ddMMyyyy"
Expand Down

0 comments on commit d2d6455

Please sign in to comment.