mirror of
https://github.com/Crocmagnon/display-epaper.git
synced 2024-12-22 20:11:46 +01:00
display passé/proche
This commit is contained in:
parent
01a49beb7e
commit
16223f2135
1 changed files with 7 additions and 1 deletions
8
img.go
8
img.go
|
@ -340,8 +340,14 @@ func drawTCL(gc *draw2dimg.GraphicContext, title string, times []time.Time, now
|
|||
continue
|
||||
}
|
||||
delay := t.Sub(now).Truncate(time.Minute)
|
||||
delayStr := "passé"
|
||||
if delay > time.Minute {
|
||||
delayStr = fmt.Sprintf("%v min", delay.Minutes())
|
||||
} else if delay > 0 {
|
||||
delayStr = "proche"
|
||||
}
|
||||
y := yoffset + float64(j+1)*35
|
||||
text(gc, fmt.Sprintf("%v min", delay.Minutes()), 22, x, y, fonts.Regular)
|
||||
text(gc, delayStr, 22, x, y, fonts.Regular)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue