Skip to content

Commit

Permalink
remove unused showPeriod (#12670)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Apr 23, 2023
1 parent d6a3d26 commit 7dc1df1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/templating/DateHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import chess.format.pgn.Tag.Date

trait DateHelper { self: I18nHelper with StringHelper with NumberHelper =>

export PeriodLocales.{ showPeriod, showDuration }
export PeriodLocales.showDuration

private val dateTimeStyle = "MS"
private val dateStyle = "M-"
Expand Down
5 changes: 1 addition & 4 deletions modules/i18n/src/main/PeriodLocales.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package lila.i18n
import org.joda.time.format.{ PeriodFormat, PeriodFormatter }
import org.joda.time.{ DurationFieldType, PeriodType, Period as JodaPeriod }
import play.api.i18n.Lang
import java.time.{ Duration, Period }
import java.time.Duration

// TODO replace with threeten-extra?
// https://www.threeten.org/threeten-extra/apidocs/org.threeten.extra/org/threeten/extra/AmountFormats.html
Expand All @@ -18,8 +18,5 @@ object PeriodLocales:
private def periodFormatter(using lang: Lang): PeriodFormatter =
PeriodFormat wordBased lang.locale

def showPeriod(period: Period)(using Lang): String =
periodFormatter print JodaPeriod(period).normalizedStandard(periodType)

def showDuration(duration: Duration)(using Lang): String =
periodFormatter print JodaPeriod(duration.toMillis).normalizedStandard(periodType)

0 comments on commit 7dc1df1

Please sign in to comment.