chore: Better times
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
parent
f1aa9cbf16
commit
c5cb76a731
2 changed files with 3 additions and 6 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"git.sr.ht/~timharek/yr/cmd/flags"
|
||||
"git.sr.ht/~timharek/yr/cmd/internal/ui/table"
|
||||
|
@ -83,7 +82,7 @@ func forecast(cmd *cobra.Command, args []string) {
|
|||
itemTime = item.Time
|
||||
}
|
||||
t.Row(
|
||||
itemTime.Format(time.DateTime),
|
||||
itemTime.Format("Mon, 2 Jan 15:04"),
|
||||
fmt.Sprintf("%.1f °C", item.Temperature),
|
||||
fmt.Sprintf("%.1f mm", item.Percipitation),
|
||||
fmt.Sprintf("%.1f m/s %s", item.Wind.Speed, item.Wind.DirectionToString()),
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"git.sr.ht/~timharek/yr/cmd/flags"
|
||||
"git.sr.ht/~timharek/yr/internal/nominatim"
|
||||
|
@ -77,14 +76,13 @@ func now(cmd *cobra.Command, args []string) {
|
|||
itemTime = n.Time
|
||||
}
|
||||
fmt.Printf(
|
||||
`%s now:
|
||||
%s
|
||||
`%s %s:
|
||||
Temperature: %.1f °C
|
||||
Rain: %.1f mm
|
||||
Wind: %.1f m/s from %s
|
||||
`,
|
||||
n.Location,
|
||||
itemTime.Format(time.DateTime),
|
||||
itemTime.Format("Monday 2 Jan 15:04"),
|
||||
n.Temperature,
|
||||
n.Percipitation,
|
||||
n.Wind.Speed,
|
||||
|
|
Loading…
Reference in a new issue