mirror of https://github.com/velour/catbase.git
web: format time string
This commit is contained in:
parent
25f9171223
commit
95ae28aa0f
|
@ -14,6 +14,6 @@ func New() *Stats {
|
|||
return &Stats{startTime: time.Now()}
|
||||
}
|
||||
|
||||
func (s Stats) Uptime() time.Duration {
|
||||
return time.Now().Sub(s.startTime)
|
||||
func (s Stats) Uptime() string {
|
||||
return time.Now().Sub(s.startTime).Truncate(time.Second).String()
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ templ (w *Web) showStats() {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Uptime</td>
|
||||
<td>{ fmt.Sprintf("%v", w.stats.Uptime()) }</td>
|
||||
<td>{ w.stats.Uptime() }</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -314,9 +314,9 @@ func (w *Web) showStats() templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%v", w.stats.Uptime()))
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(w.stats.Uptime())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `bot/web/index.templ`, Line: 78, Col: 53}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `bot/web/index.templ`, Line: 78, Col: 34}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
Loading…
Reference in New Issue