Quellcode durchsuchen

Renames Dates.toFormatter to getFormatter

main
Eric Amodio vor 5 Jahren
Ursprung
Commit
65440a42b3
3 geänderte Dateien mit 5 neuen und 9 gelöschten Zeilen
  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 Datei anzeigen

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

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

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

Laden…
Abbrechen
Speichern