Skip to content

Commit 66e9638

Browse files
authored
Merge pull request #28 from aktnk-tmc/fix-date-display
change the condition to judge whether two commits are on the same day…( issue #25 )
2 parents 504fa56 + 6930ea8 commit 66e9638

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/mrkm4ntr/gitbucket/network/controller/NetworkController.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ trait NetworkControllerBase extends ControllerBase {
8989
def getDateMarker(date1: Date, date2: Option[Date]): (Option[Int], Option[Int]) = date2.map { date2 =>
9090
val dateTime1 = LocalDateTime.ofInstant(date1.toInstant, ZoneId.systemDefault())
9191
val dateTime2 = LocalDateTime.ofInstant(date2.toInstant, ZoneId.systemDefault())
92-
val day = if (ChronoUnit.DAYS.between(dateTime1, dateTime2) > 0) {
92+
val day = if (ChronoUnit.DAYS.between(dateTime1.toLocalDate, dateTime2.toLocalDate) > 0) {
9393
Some(dateTime1.getDayOfMonth)
9494
} else {
9595
None
9696
}
97-
val month = if (ChronoUnit.MONTHS.between(dateTime1, dateTime2) > 0) {
97+
val month = if (ChronoUnit.MONTHS.between(YearMonth.from(dateTime1), YearMonth.from(dateTime2)) > 0) {
9898
Some(dateTime1.getMonthValue)
9999
} else {
100100
None

0 commit comments

Comments
 (0)