This commit is contained in:
@@ -266,20 +266,23 @@ func Main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
err := "missing"
|
msg := "missing"
|
||||||
|
|
||||||
t, _ := time.ParseInLocation(transaction.Date, "2006-01-02", time.Local)
|
ts, err := time.ParseInLocation("2006-01-02", transaction.Date, time.Local)
|
||||||
dayBefore := t.Add(-24 * time.Hour).Format("2006-01-02")
|
if err != nil {
|
||||||
dayAfter := t.Add(-24 * time.Hour).Format("2006-01-02")
|
panic(err)
|
||||||
|
}
|
||||||
|
dayBefore := ts.Add(-24 * time.Hour).Format("2006-01-02")
|
||||||
|
dayAfter := ts.Add(-24 * time.Hour).Format("2006-01-02")
|
||||||
if inDay(dayBefore, transaction) || inDay(dayAfter, transaction) {
|
if inDay(dayBefore, transaction) || inDay(dayAfter, transaction) {
|
||||||
err = "1dayoff"
|
msg = "1dayoff"
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix := " "
|
prefix := " "
|
||||||
if transaction.Status != "posted" {
|
if transaction.Status != "posted" {
|
||||||
prefix = "! "
|
prefix = "! "
|
||||||
}
|
}
|
||||||
fmt.Printf("[%s] %s $%7.2f %s%s (%s)\n", err, transaction.Date, transaction.Amount, prefix, transaction.Details.CounterParty.Name, transaction.Description)
|
fmt.Printf("[%s] %s $%7.2f %s%s (%s)\n", msg, transaction.Date, transaction.Amount, prefix, transaction.Details.CounterParty.Name, transaction.Description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "reg":
|
case "reg":
|
||||||
|
|||||||
Reference in New Issue
Block a user