Fix bug in i3status - active timer
This commit is contained in:
parent
2b357839e9
commit
59cd554e03
2
model.go
2
model.go
@ -13,7 +13,7 @@ import (
|
|||||||
// Return the most recent done from timer.txt or dont.txt
|
// Return the most recent done from timer.txt or dont.txt
|
||||||
func (a *AppState) getMostRecentTimer() (*timertxt.Timer, error) {
|
func (a *AppState) getMostRecentTimer() (*timertxt.Timer, error) {
|
||||||
work, wErr := a.TimerList.GetMostRecentTimer()
|
work, wErr := a.TimerList.GetMostRecentTimer()
|
||||||
if wErr != nil && work.FinishDate.IsZero() {
|
if wErr == nil && work.FinishDate.IsZero() {
|
||||||
return work, nil
|
return work, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ func (a *AppState) opI3Status(args []string) int {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
var text string
|
var text string
|
||||||
if !wrk.Finished {
|
if wrk.FinishDate.IsZero() {
|
||||||
wrkDur := wrk.Duration().Round(time.Minute * 15)
|
wrkDur := wrk.Duration().Round(time.Minute * 15)
|
||||||
hrs := int(wrkDur.Hours())
|
hrs := int(wrkDur.Hours())
|
||||||
mins := int(wrkDur.Minutes()) - hrs*60
|
mins := int(wrkDur.Minutes()) - hrs*60
|
||||||
|
Loading…
Reference in New Issue
Block a user