Explorar el Código

Adds defaultTimeFormat setting

main
Eric Amodio hace 3 años
padre
commit
bfd8d78ced
Se han modificado 14 ficheros con 93 adiciones y 5 borrados
  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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar