From f8d12f7b0d4af1b1769b89e80c87f9c169678564 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian@dold.me>
Date: Fri, 18 Mar 2022 15:32:41 +0100
Subject: wallet: t_s/d_us migration

---
 .../src/wallet/BackupPage.tsx                          | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/BackupPage.tsx')

diff --git a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
index e1d34748b..8c12201b9 100644
--- a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
@@ -14,7 +14,7 @@
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 
-import { Timestamp, Translate } from "@gnu-taler/taler-util";
+import { AbsoluteTime, Translate } from "@gnu-taler/taler-util";
 import {
   ProviderInfo,
   ProviderPaymentPaid,
@@ -104,7 +104,13 @@ export function BackupView({
           <BackupLayout
             key={idx}
             status={provider.paymentStatus}
-            timestamp={provider.lastSuccessfulBackupTimestamp}
+            timestamp={
+              provider.lastSuccessfulBackupTimestamp
+                ? AbsoluteTime.fromTimestamp(
+                    provider.lastSuccessfulBackupTimestamp,
+                  )
+                : undefined
+            }
             id={provider.syncProviderBaseUrl}
             active={provider.active}
             title={provider.name}
@@ -144,7 +150,7 @@ export function BackupView({
 
 interface TransactionLayoutProps {
   status: ProviderPaymentStatus;
-  timestamp?: Timestamp;
+  timestamp?: AbsoluteTime;
   title: string;
   id: string;
   active: boolean;
@@ -192,7 +198,7 @@ function BackupLayout(props: TransactionLayoutProps): VNode {
   );
 }
 
-function ExpirationText({ until }: { until: Timestamp }): VNode {
+function ExpirationText({ until }: { until: AbsoluteTime }): VNode {
   const { i18n } = useTranslationContext();
   return (
     <Fragment>
@@ -207,13 +213,13 @@ function ExpirationText({ until }: { until: Timestamp }): VNode {
   );
 }
 
-function colorByTimeToExpire(d: Timestamp): string {
+function colorByTimeToExpire(d: AbsoluteTime): string {
   if (d.t_ms === "never") return "rgb(28, 184, 65)";
   const months = differenceInMonths(d.t_ms, new Date());
   return months > 1 ? "rgb(28, 184, 65)" : "rgb(223, 117, 20)";
 }
 
-function daysUntil(d: Timestamp): string {
+function daysUntil(d: AbsoluteTime): string {
   if (d.t_ms === "never") return "";
   const duration = intervalToDuration({
     start: d.t_ms,
-- 
cgit v1.2.3

