gitkraken/vscode-gitlens

Simplify switching between relative and absolute date formatting

s-KaiNet opened this issue · 4 comments

Hi, thank you for the great work on the project!
I'm just curious if it's possible to change gitlens result view to show the actual date of commit:
image

Sometimes it's more convenient to know an exact date, to find in an external git client. Deducting 28 days from today isn't a trivial task 😉. For example 28 days ago, Feb 25, 2018

BTW the same applies to inline code highlights and on-hover popup. Maybe it's possible to make it configurable.

You can control this today. Although it is spread across a few places.

First you can set "gitlens.defaultDateStyle": "absolute" (rather than the default relative), and that will change all the dates that don't have specific overrides to use the gitlens.defaultDateFormat. See https://github.com/eamodio/vscode-gitlens#general-settings

Then you would also need to change the format templates for each of the other areas you wish to control.

For the current line blame, see https://github.com/eamodio/vscode-gitlens#current-line-blame-settings

  1. gitlens.currentLine.format change that to use {date} rather than {ago}

For the gutter blame, see https://github.com/eamodio/vscode-gitlens#gutter-blame-settings

  1. gitlens.blame.format change that to use {date} rather than {ago}

For the status bar, see https://github.com/eamodio/vscode-gitlens#status-bar-settings

  1. gitlens.statusBar.format change that to use {date} rather than {ago}

For the GitLens and GitLens Results views, see: https://github.com/eamodio/vscode-gitlens#explorer-settings

  1. gitlens.explorers.commitFormat change that to use {date} rather than {ago}
  2. gitlens.explorers.stashFormat change that to use {date} rather than {ago}

Given how many options need to be tweaked here, I think I will introduce 2 new tokens agoOrDate and authorAgoOrDate, and then will switch the defaults of all those formats to use those rather than ago and authorAgo. And the behavior of agoOrDate and authorAgoOrDate would honor the gitlens.defaultDateStyle setting.

Thank you for the report and I hope that helps!

Thank you for such a detailed answer and good news on a new feature! :)

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.