From 473ecfe55870023eff30e913df2c379428dc13b7 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 22 Dec 2021 03:27:27 -0500 Subject: [PATCH] Fixes #1601: normalizes time example to local time --- CHANGELOG.md | 1 + src/webviews/apps/shared/appWithConfigBase.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca31eae..7f77187 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Fixes [#1572](https://github.com/gitkraken/vscode-gitlens/issues/1572) - Forced regular expression search in changes - Fixes [#1473](https://github.com/gitkraken/vscode-gitlens/issues/1473) - Support VSCodium in interactive rebase editor - Fixes [#1699](https://github.com/gitkraken/vscode-gitlens/issues/1699) - Exception has occurred: RangeError [ERR_OUT_OF_RANGE] +- Fixes [#1601](https://github.com/gitkraken/vscode-gitlens/issues/1601) - Add a better time sample in "Dates & Times" setting - Fixes performance issue with the rich hover on the status bar blame - Fixes cross repository branch switching via the _Git Command Palette_ - Fixes an issue with TOC entries in the VS Code settings editor diff --git a/src/webviews/apps/shared/appWithConfigBase.ts b/src/webviews/apps/shared/appWithConfigBase.ts index 87a4b14..ee450c5 100644 --- a/src/webviews/apps/shared/appWithConfigBase.ts +++ b/src/webviews/apps/shared/appWithConfigBase.ts @@ -13,7 +13,10 @@ import { getDateFormatter } from '../shared/date'; import { App } from './appBase'; import { DOM } from './dom'; -const dateFormatter = getDateFormatter(new Date('Wed Jul 25 2018 19:18:00 GMT-0400')); +const offset = (new Date().getTimezoneOffset() / 60) * 100; +const dateFormatter = getDateFormatter( + new Date(`Wed Jul 25 2018 19:18:00 GMT${offset >= 0 ? '-' : '+'}${String(Math.abs(offset)).padStart(4, '0')}`), +); let ipcSequence = 0; function nextIpcId() {