diff --git a/src/git/models/commit.ts b/src/git/models/commit.ts index c3cb3a8..69fe2d1 100644 --- a/src/git/models/commit.ts +++ b/src/git/models/commit.ts @@ -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 { diff --git a/src/system/date.ts b/src/system/date.ts index bb19eb4..3ff6944 100644 --- a/src/system/date.ts +++ b/src/system/date.ts @@ -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); } } diff --git a/src/views/nodes/repositoryNode.ts b/src/views/nodes/repositoryNode.ts index 49c55de..1514cca 100644 --- a/src/views/nodes/repositoryNode.ts +++ b/src/views/nodes/repositoryNode.ts @@ -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()