Browse Source

Renames Dates.toFormatter to getFormatter

main
Eric Amodio 5 years ago
parent
commit
65440a42b3
3 changed files with 5 additions and 9 deletions
  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 View 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 View 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 View 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()

Loading…
Cancel
Save