Ver a proveniência

Renames Dates.toFormatter to getFormatter

main
Eric Amodio há 5 anos
ascendente
cometimento
65440a42b3
3 ficheiros alterados com 5 adições e 9 eliminações
  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 Ver ficheiro

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

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

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

Carregando…
Cancelar
Guardar