mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-15 01:25:42 -05:00
Adds default date format
This commit is contained in:
@@ -158,7 +158,11 @@ export class CommitFormatter {
|
||||
return Strings.interpolate(template, new CommitFormatter(commit, options));
|
||||
}
|
||||
|
||||
static toHoverAnnotation(commit: GitCommit, dateFormat: string = 'MMMM Do, YYYY h:MMa'): string | string[] {
|
||||
static toHoverAnnotation(commit: GitCommit, dateFormat: string | null): string | string[] {
|
||||
if (dateFormat === null) {
|
||||
dateFormat = 'MMMM Do, YYYY h:MMa';
|
||||
}
|
||||
|
||||
const message = commit.isUncommitted ? '' : `\n\n> ${commit.message.replace(/\n/g, ' \n')}`;
|
||||
return `\`${commit.shortSha}\` __${commit.author}__, ${moment(commit.date).fromNow()} _(${moment(commit.date).format(dateFormat)})_${message}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user