Quellcode durchsuchen

Adds defaultTimeFormat setting

main
Eric Amodio vor 4 Jahren
Ursprung
Commit
bfd8d78ced
14 geänderte Dateien mit 93 neuen und 5 gelöschten Zeilen
  1. +9
    -0
      package.json
  2. +1
    -0
      src/config.ts
  3. +2
    -0
      src/views/branchesView.ts
  4. +3
    -1
      src/views/commitsView.ts
  5. +3
    -1
      src/views/contributorsView.ts
  6. +2
    -0
      src/views/fileHistoryView.ts
  7. +3
    -1
      src/views/lineHistoryView.ts
  8. +2
    -0
      src/views/remotesView.ts
  9. +2
    -0
      src/views/repositoriesView.ts
  10. +3
    -1
      src/views/searchAndCompareView.ts
  11. +3
    -1
      src/views/stashesView.ts
  12. +2
    -0
      src/views/tagsView.ts
  13. +29
    -0
      src/webviews/apps/settings/partials/dates.html
  14. +29
    -0
      src/webviews/apps/welcome/welcome.html

+ 9
- 0
package.json Datei anzeigen

@ -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",

+ 1
- 0
src/config.ts Datei anzeigen

@ -46,6 +46,7 @@ export interface Config {
defaultDateSource: DateSource;
defaultDateStyle: DateStyle;
defaultGravatarsStyle: GravatarDefaultStyle;
defaultTimeFormat: string | null;
fileAnnotations: {
command: string | null;
};

+ 2
- 0
src/views/branchesView.ts Datei anzeigen

@ -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;

+ 3
- 1
src/views/commitsView.ts Datei anzeigen

@ -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;
}

+ 3
- 1
src/views/contributorsView.ts Datei anzeigen

@ -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, 'defaultGravatarsStyle') &&
!configuration.changed(e, 'defaultTimeFormat')
) {
return false;
}

+ 2
- 0
src/views/fileHistoryView.ts Datei anzeigen

@ -89,9 +89,11 @@ export class FileHistoryView 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, 'advanced', 'fileHistoryFollowsRenames') &&
!configuration.changed(e, 'advanced', 'fileHistoryShowAllBranches')
) {

+ 3
- 1
src/views/lineHistoryView.ts Datei anzeigen

@ -52,9 +52,11 @@ export class LineHistoryView 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;
}

+ 2
- 0
src/views/remotesView.ts Datei anzeigen

@ -178,9 +178,11 @@ export class RemotesView 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')
) {

+ 2
- 0
src/views/repositoriesView.ts Datei anzeigen

@ -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, 'defaultTimeFormat') &&
!configuration.changed(e, 'sortBranchesBy') &&
!configuration.changed(e, 'sortTagsBy')
) {

+ 3
- 1
src/views/searchAndCompareView.ts Datei anzeigen

@ -316,9 +316,11 @@ export class SearchAndCompareView 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;
}

+ 3
- 1
src/views/stashesView.ts Datei anzeigen

@ -138,9 +138,11 @@ export class StashesView 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;
}

+ 2
- 0
src/views/tagsView.ts Datei anzeigen

@ -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;

+ 29
- 0
src/webviews/apps/settings/partials/dates.html Datei anzeigen

@ -89,6 +89,35 @@
></span>
</span>
</div>
<div class="setting">
<div class="setting__input">
<label for="defaultTimeFormat">Time&nbsp;format</label>
<input
id="defaultTimeFormat"
name="defaultTimeFormat"
type="text"
placeholder="defaults to h:mma"
data-setting
data-setting-preview
/>
<a
class="link__learn-more"
title="See Moment.js docs for valid date formats"
href="https://momentjs.com/docs/#/displaying/format/"
>
<i class="icon icon__info"></i>
</a>
</div>
<span class="setting__hint"
>Example date:
<span
data-setting-preview="defaultTimeFormat"
data-setting-preview-type="date"
data-setting-preview-default="h:mma"
></span>
</span>
</div>
</div>
</div>
</div>

+ 29
- 0
src/webviews/apps/welcome/welcome.html Datei anzeigen

@ -394,6 +394,35 @@
></span>
</span>
</div>
<div class="setting">
<div class="setting__input">
<label for="defaultTimeFormat">Time&nbsp;format</label>
<input
id="defaultTimeFormat"
name="defaultTimeFormat"
type="text"
placeholder="defaults to h:mma"
data-setting
data-setting-preview
/>
<a
class="link__learn-more"
title="See Moment.js docs for valid date formats"
href="https://momentjs.com/docs/#/displaying/format/"
>
<i class="icon icon__info"></i>
</a>
</div>
<span class="setting__hint"
>Example date:
<span
data-setting-preview="defaultTimeFormat"
data-setting-preview-type="date"
data-setting-preview-default="h:mma"
></span>
</span>
</div>
</div>
</div>
</section>

Laden…
Abbrechen
Speichern