Skip to content

Commit

Permalink
Display battle time
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Mar 10, 2024
1 parent ba12e44 commit d69b587
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/models/Schema.scala
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ object Schema {
.appendHourOfDay(2)
.appendLiteral(':')
.appendMinuteOfHour(2)
.appendLiteral(" UTC")
.toFormatter
.withZone(DateTimeZone.UTC)

def formatCreatedTime(): String = {
createdTimeFormatter.print(created)
Expand Down
2 changes: 1 addition & 1 deletion app/views/battle/view.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<link rel="stylesheet" type="text/css" href="@assetsFinder.path("dist/battle_css.css")">
<script src="@assetsFinder.path("dist/battle_js.js")" type="text/javascript"></script>

<h4 class="text-center text-gray">battle #@fullBattle.b.id.id, @fullBattle.b.formatCreated()</h4>
<h4 class="text-center text-gray">battle #@fullBattle.b.id.id, @fullBattle.b.formatCreatedTime()</h4>
<h1 class="mt-3 mb-2 text-center">
@fullBattle.b.winner match {
case Some(Team.R1) => {
Expand Down
2 changes: 1 addition & 1 deletion app/views/battleRows.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@for(FullBattle(battle, r1, r2) <- battles) {
<tr>
<td class="text-gray">@battle.formatCreated()</td>
<td class="text-gray">@battle.formatCreatedTime()</td>
<td><a href="@routes.BattleController.view(battle.id.id)">
<img src="@assetsFinder.path("images/battle.svg")">
#@battle.id.id
Expand Down
2 changes: 1 addition & 1 deletion app/views/board/robot.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1><a href="@routes.BoardController.view(boardWithBattles.board.id.id)">@boardW
@for(FullBattle(battle, r1, r2) <- boardWithBattles.battles) {
@defining(if (r1.id == robot.id) { (r1, r2) } else (r2, r1)) { case (ourR, otherR) =>
<tr>
<td class="text-gray">@battle.formatCreated()</td>
<td class="text-gray">@battle.formatCreatedTime()</td>
<td><a href="@routes.BattleController.view(battle.id.id)">
<img src="@assetsFinder.path("images/battle.svg")">
#@battle.id.id
Expand Down

0 comments on commit d69b587

Please sign in to comment.