Sfoglia il codice sorgente

Renames Dates.toFormatter to getFormatter

main
Eric Amodio 5 anni fa
parent
commit
65440a42b3
3 ha cambiato i file con 5 aggiunte e 9 eliminazioni
  1. +2
    -2
      src/git/models/commit.ts
  2. +2
    -6
      src/system/date.ts
  3. +1
    -1
      src/views/nodes/repositoryNode.ts

+ 2
- 2
src/git/models/commit.ts Vedi File

@ -173,12 +173,12 @@ export abstract class GitCommit {
@memoize()
private get authorDateFormatter(): Dates.DateFormatter {
return Dates.toFormatter(this.authorDate);
return Dates.getFormatter(this.authorDate);
}
@memoize()
private get committerDateFormatter(): Dates.DateFormatter {
return Dates.toFormatter(this.committerDate);
return Dates.getFormatter(this.committerDate);
}
private get dateFormatter(): Dates.DateFormatter {

+ 2
- 6
src/system/date.ts Vedi File

@ -16,11 +16,7 @@ export namespace Dates {
format(format: string): string;
}
export function toFormatter(date: Date): DateFormatter {
const wrappedDate = dayjs(date);
return {
fromNow: () => wrappedDate.fromNow(),
format: (format: string) => wrappedDate.format(format)
};
export function getFormatter(date: Date): DateFormatter {
return dayjs(date);
}
}

+ 1
- 1
src/views/nodes/repositoryNode.ts Vedi File

@ -314,7 +314,7 @@ export class RepositoryNode extends SubscribeableViewNode {
format = `h:mma, ${format}`;
}
return `${options.prefix || ''}${Dates.toFormatter(new Date(this._lastFetched)).format(format)}`;
return `${options.prefix || ''}${Dates.getFormatter(new Date(this._lastFetched)).format(format)}`;
}
// @debug()

Caricamento…
Annulla
Salva