From 4af6bd16287a3b15b32211be20d9ab1e8dc0b45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20Liss=C3=A9?= Date: Tue, 23 Apr 2019 13:55:57 +0200 Subject: [PATCH] Localize timestamp formatting --- cmd/tracker.go | 5 ++--- tests/features/tracker.feature | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/tracker.go b/cmd/tracker.go index 2ca2dcf..8a0d2a0 100644 --- a/cmd/tracker.go +++ b/cmd/tracker.go @@ -5,7 +5,6 @@ import ( "github.com/cheynewallace/tabby" "github.com/leanovate/mite-go/domain" "github.com/spf13/cobra" - "time" ) var ( @@ -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 @@ -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") } diff --git a/tests/features/tracker.feature b/tests/features/tracker.feature index 123d88d..cfbcc14 100644 --- a/tests/features/tracker.feature +++ b/tests/features/tracker.feature @@ -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 """