From b2ea2e416740ff33f0cd6533bf970dc5a34ebc71 Mon Sep 17 00:00:00 2001 From: tmkn Date: Sun, 24 Nov 2019 01:47:58 +0100 Subject: [PATCH] fix: formatDate --- src/utils/package.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/package.ts b/src/utils/package.ts index d8e2f3ad9..dff2ba9a2 100644 --- a/src/utils/package.ts +++ b/src/utils/package.ts @@ -52,7 +52,9 @@ export function formatRepository(repository: any): string | null { } export function formatDate(lastUpdate: string | number): string { - return format(new Date(lastUpdate), TIMEFORMAT); + const dt = new Date(lastUpdate); + + return format(new Date(dt.valueOf() + dt.getTimezoneOffset() * 60 * 1000), TIMEFORMAT); } export function formatDateDistance(lastUpdate: Date | string | number): string {