Skip to content

Commit 65440a4

Browse files
committed
Renames Dates.toFormatter to getFormatter
1 parent 81f931e commit 65440a4

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/git/models/commit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ export abstract class GitCommit {
173173

174174
@memoize()
175175
private get authorDateFormatter(): Dates.DateFormatter {
176-
return Dates.toFormatter(this.authorDate);
176+
return Dates.getFormatter(this.authorDate);
177177
}
178178

179179
@memoize()
180180
private get committerDateFormatter(): Dates.DateFormatter {
181-
return Dates.toFormatter(this.committerDate);
181+
return Dates.getFormatter(this.committerDate);
182182
}
183183

184184
private get dateFormatter(): Dates.DateFormatter {

src/system/date.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ export namespace Dates {
1616
format(format: string): string;
1717
}
1818

19-
export function toFormatter(date: Date): DateFormatter {
20-
const wrappedDate = dayjs(date);
21-
return {
22-
fromNow: () => wrappedDate.fromNow(),
23-
format: (format: string) => wrappedDate.format(format)
24-
};
19+
export function getFormatter(date: Date): DateFormatter {
20+
return dayjs(date);
2521
}
2622
}

src/views/nodes/repositoryNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export class RepositoryNode extends SubscribeableViewNode<RepositoriesView> {
314314
format = `h:mma, ${format}`;
315315
}
316316

317-
return `${options.prefix || ''}${Dates.toFormatter(new Date(this._lastFetched)).format(format)}`;
317+
return `${options.prefix || ''}${Dates.getFormatter(new Date(this._lastFetched)).format(format)}`;
318318
}
319319

320320
// @debug()

0 commit comments

Comments
 (0)