From 0d57e0a315e87d5fa0d409768d54b2174264faa7 Mon Sep 17 00:00:00 2001
From: matograine <tom.ngr@zaclys.net>
Date: Thu, 6 May 2021 16:13:46 +0200
Subject: [PATCH] [enh] #344 Membership : display time in local timezone.

---
 silkaj/membership.py     | 7 +++----
 tests/test_membership.py | 4 +++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/silkaj/membership.py b/silkaj/membership.py
index a9b63ffb..da81a4fa 100644
--- a/silkaj/membership.py
+++ b/silkaj/membership.py
@@ -30,7 +30,7 @@ from silkaj.tools import coroutine
 from silkaj.network_tools import ClientInstance
 from silkaj.blockchain_tools import BlockchainParams, HeadBlock
 from silkaj.license import license_approval
-from silkaj.constants import SUCCESS_EXIT_STATUS
+from silkaj.constants import SUCCESS_EXIT_STATUS, DATE
 
 
 @click.command(
@@ -137,9 +137,8 @@ async def display_confirmation_table(identity_uid, pubkey, identity_timestamp):
     table.append(["Block Identity", str(identity_timestamp)[:45] + "…"])
 
     block = await client(bma.blockchain.block, identity_timestamp.number)
-    table.append(
-        ["Identity published", pendulum.from_timestamp(block["time"]).format("LL")]
-    )
+    date_idty_pub = pendulum.from_timestamp(block["time"], tz="local").format(DATE)
+    table.append(["Identity published", date_idty_pub])
 
     params = await BlockchainParams().params
     membership_validity = (
diff --git a/tests/test_membership.py b/tests/test_membership.py
index 7ae7f5fb..c763ffb7 100644
--- a/tests/test_membership.py
+++ b/tests/test_membership.py
@@ -47,6 +47,7 @@ from silkaj.blockchain_tools import BlockchainParams, HeadBlock
 from silkaj.constants import (
     SUCCESS_EXIT_STATUS,
     FAILURE_EXIT_STATUS,
+    DATE,
 )
 from silkaj.tui import display_pubkey_and_checksum
 
@@ -179,8 +180,9 @@ async def test_display_confirmation_table(
     table.append(["Block Identity", str(identity_timestamp)[:45] + "…"])
 
     block = await client(bma.blockchain.block, identity_timestamp.number)
+    date_idty_pub = pendulum.from_timestamp(block["time"], tz="local").format(DATE)
     table.append(
-        ["Identity published", pendulum.from_timestamp(block["time"]).format("LL")],
+        ["Identity published", date_idty_pub],
     )
 
     params = await BlockchainParams().params
-- 
GitLab