Skip to content

Commit

Permalink
Localize timestamp formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Lissé committed Apr 23, 2019
1 parent 7857674 commit 4af6bd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cmd/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/cheynewallace/tabby"
"github.com/leanovate/mite-go/domain"
"github.com/spf13/cobra"
"time"
)

var (
Expand Down Expand Up @@ -41,7 +40,7 @@ var trackerStatusCommand = &cobra.Command{

t := tabby.New()
t.AddHeader("id", "time", "state", "since")
t.AddLine(tracking.Id, tracking.Minutes, "tracking", tracking.Since)
t.AddLine(tracking.Id, tracking.Minutes, "tracking", tracking.Since.In(application.Conf.GetDisplayLocation()))
t.Print()

return nil
Expand Down Expand Up @@ -69,7 +68,7 @@ var trackerStartCommand = &cobra.Command{

t := tabby.New()
t.AddHeader("id", "time", "state", "since")
t.AddLine(tracking.Id, tracking.Minutes, "tracking", tracking.Since.In(time.Local))
t.AddLine(tracking.Id, tracking.Minutes, "tracking", tracking.Since.In(application.Conf.GetDisplayLocation()))
if stopped != nil {
t.AddLine(stopped.Id, stopped.Minutes, "stopped")
}
Expand Down
3 changes: 2 additions & 1 deletion tests/features/tracker.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Feature: tracker
}
"""
And Mite is setup to connect to this mock server
When I execute "-c .mite.toml config display.location=Europe/Berlin"
Then "-c .mite.toml tracker status" should return the following:
"""
id time state since
-- ---- ----- -----
36135321 4h7m tracking 2015-10-15 15:05:04 +0000 UTC
36135321 4h7m tracking 2015-10-15 17:05:04 +0200 CEST
"""

0 comments on commit 4af6bd1

Please sign in to comment.