diff --git a/package.json b/package.json index 276abab..6a5d04f 100644 --- a/package.json +++ b/package.json @@ -615,6 +615,15 @@ "markdownDescription": "Specifies the style of the gravatar default (fallback) images", "scope": "window" }, + "gitlens.defaultTimeFormat": { + "type": [ + "string", + "null" + ], + "default": null, + "markdownDescription": "Specifies how times will be formatted by default. See the [Moment.js docs](https://momentjs.com/docs/#/displaying/format/) for valid formats", + "scope": "window" + }, "gitlens.fileAnnotations.command": { "type": [ "string", diff --git a/src/config.ts b/src/config.ts index 7978369..41d6056 100644 --- a/src/config.ts +++ b/src/config.ts @@ -46,6 +46,7 @@ export interface Config { defaultDateSource: DateSource; defaultDateStyle: DateStyle; defaultGravatarsStyle: GravatarDefaultStyle; + defaultTimeFormat: string | null; fileAnnotations: { command: string | null; }; diff --git a/src/views/branchesView.ts b/src/views/branchesView.ts index 18fd521..b3f9960 100644 --- a/src/views/branchesView.ts +++ b/src/views/branchesView.ts @@ -192,9 +192,11 @@ export class BranchesView extends ViewBase if ( !changed && !configuration.changed(e, 'defaultDateFormat') && + !configuration.changed(e, 'defaultDateShortFormat') && !configuration.changed(e, 'defaultDateSource') && !configuration.changed(e, 'defaultDateStyle') && !configuration.changed(e, 'defaultGravatarsStyle') && + !configuration.changed(e, 'defaultTimeFormat') && !configuration.changed(e, 'sortBranchesBy') ) { return false; diff --git a/src/views/commitsView.ts b/src/views/commitsView.ts index 96dfe2e..5c62179 100644 --- a/src/views/commitsView.ts +++ b/src/views/commitsView.ts @@ -325,9 +325,11 @@ export class CommitsView extends ViewBase { if ( !changed && !configuration.changed(e, 'defaultDateFormat') && + !configuration.changed(e, 'defaultDateShortFormat') && !configuration.changed(e, 'defaultDateSource') && !configuration.changed(e, 'defaultDateStyle') && - !configuration.changed(e, 'defaultGravatarsStyle') + !configuration.changed(e, 'defaultGravatarsStyle') && + !configuration.changed(e, 'defaultTimeFormat') ) { return false; } diff --git a/src/views/contributorsView.ts b/src/views/contributorsView.ts index 3fb789f..af214a3 100644 --- a/src/views/contributorsView.ts +++ b/src/views/contributorsView.ts @@ -142,9 +142,11 @@ export class ContributorsView extends ViewBase { if ( !changed && !configuration.changed(e, 'defaultDateFormat') && + !configuration.changed(e, 'defaultDateShortFormat') && !configuration.changed(e, 'defaultDateSource') && !configuration.changed(e, 'defaultDateStyle') && !configuration.changed(e, 'defaultGravatarsStyle') && + !configuration.changed(e, 'defaultTimeFormat') && !configuration.changed(e, 'integrations', 'enabled') && !configuration.changed(e, 'sortBranchesBy') ) { diff --git a/src/views/repositoriesView.ts b/src/views/repositoriesView.ts index 0add08d..b1a3164 100644 --- a/src/views/repositoriesView.ts +++ b/src/views/repositoriesView.ts @@ -104,9 +104,11 @@ export class RepositoriesView extends ViewBase { if ( !changed && !configuration.changed(e, 'defaultDateFormat') && + !configuration.changed(e, 'defaultDateShortFormat') && !configuration.changed(e, 'defaultDateSource') && !configuration.changed(e, 'defaultDateStyle') && - !configuration.changed(e, 'defaultGravatarsStyle') + !configuration.changed(e, 'defaultGravatarsStyle') && + !configuration.changed(e, 'defaultTimeFormat') ) { return false; } diff --git a/src/views/tagsView.ts b/src/views/tagsView.ts index f9a761a..6bf153d 100644 --- a/src/views/tagsView.ts +++ b/src/views/tagsView.ts @@ -151,9 +151,11 @@ export class TagsView extends ViewBase { if ( !changed && !configuration.changed(e, 'defaultDateFormat') && + !configuration.changed(e, 'defaultDateShortFormat') && !configuration.changed(e, 'defaultDateSource') && !configuration.changed(e, 'defaultDateStyle') && !configuration.changed(e, 'defaultGravatarsStyle') && + !configuration.changed(e, 'defaultTimeFormat') && !configuration.changed(e, 'sortTagsBy') ) { return false; diff --git a/src/webviews/apps/settings/partials/dates.html b/src/webviews/apps/settings/partials/dates.html index c4da7e2..71a69d8 100644 --- a/src/webviews/apps/settings/partials/dates.html +++ b/src/webviews/apps/settings/partials/dates.html @@ -89,6 +89,35 @@ > + +
+
+ + + + + +
+ Example date: + + +
diff --git a/src/webviews/apps/welcome/welcome.html b/src/webviews/apps/welcome/welcome.html index f7109ac..06ef503 100644 --- a/src/webviews/apps/welcome/welcome.html +++ b/src/webviews/apps/welcome/welcome.html @@ -394,6 +394,35 @@ > + +
+
+ + + + + +
+ Example date: + + +