package Ġde . ch rist ine co enen . code . z app . utils . view Ċ Ċ import Ġorg . joda . time . Duration Ċ import Ġorg . joda . time . Period Ċ import Ġorg . joda . time . format . Period Formatter Builder Ċ Ċ object ĠShow Duration Formatter Ġ{ ĊĊ ĉ private Ġval Ġhour Period Formatter Ġ= ĠPeriod Formatter Builder () Ċĉ ĉ . append Hours () Ċĉ ĉ . append Separator If Fields Before (" h Ġ") Ċĉ ĉ . append Minutes () Ċĉ ĉ . append Separator If Fields Before (" m ") Ċĉ ĉ . to Formatter () ĊĊ ĉ private Ġval Ġseconds Period Formatter Ġ= ĠPeriod Formatter Builder () Ċĉ ĉ . append Minutes () Ċĉ ĉ . append Separator If Fields Before (" m Ġ") Ċĉ ĉ . append Seconds () Ċĉ ĉ . append Separator If Fields Before (" s ") Ċĉ ĉ . to Formatter () ĊĊ ĉ fun Ġformat Minutes ( duration : ĠInt ): ĠString Ġ{ Ċĉ ĉ val Ġperiod Ġ= ĠDuration . standard Minutes ( duration . to Long ()). to Period () Ċĉ ĉ return Ġformat ( period ) Ċ ĉ } ĊĊ ĉ fun Ġformat Seconds ( duration : ĠInt ): ĠString Ġ{ Ċĉ ĉ val Ġperiod Ġ= ĠDuration . standard Seconds ( duration . to Long ()). to Period () Ċĉ ĉ return Ġformat ( period ) Ċ ĉ } ĊĊ ĉ private Ġfun Ġformat ( period : ĠPeriod ): ĠString Ġ{ Ċĉ ĉ val Ġformatter Ġ= Ġif Ġ( period . hours Ġ> Ġ 0 ) Ġhour Period Formatter Ġelse Ġseconds Period Formatter Ċĉ ĉ return Ġperiod . toString ( formatter ) Ċ ĉ } Ċ } Ċ