mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
feat: add ability to customize time format
This commit is contained in:
@ -28,6 +28,7 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||
fullDescription bool
|
||||
cherryPickedCommitShaSet *set.Set[string]
|
||||
diffName string
|
||||
timeFormat string
|
||||
parseEmoji bool
|
||||
selectedCommitSha string
|
||||
startIdx int
|
||||
@ -203,6 +204,24 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||
sha2 pick commit2
|
||||
`),
|
||||
},
|
||||
{
|
||||
testName: "custom time format",
|
||||
commits: []*models.Commit{
|
||||
{Name: "commit1", Sha: "sha1", UnixTimestamp: 1652443200, AuthorName: "Jesse Duffield"},
|
||||
{Name: "commit2", Sha: "sha2", UnixTimestamp: 1652529600, AuthorName: "Jesse Duffield"},
|
||||
},
|
||||
fullDescription: true,
|
||||
timeFormat: "2006-01-02 15:04:05",
|
||||
startIdx: 0,
|
||||
length: 2,
|
||||
showGraph: false,
|
||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||
cherryPickedCommitShaSet: set.New[string](),
|
||||
expected: formatExpected(`
|
||||
sha1 2022-05-13 21:00:00 Jesse Duffield commit1
|
||||
sha2 2022-05-14 21:00:00 Jesse Duffield commit2
|
||||
`),
|
||||
},
|
||||
}
|
||||
|
||||
focusing := false
|
||||
@ -221,6 +240,7 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||
s.fullDescription,
|
||||
s.cherryPickedCommitShaSet,
|
||||
s.diffName,
|
||||
s.timeFormat,
|
||||
s.parseEmoji,
|
||||
s.selectedCommitSha,
|
||||
s.startIdx,
|
||||
|
Reference in New Issue
Block a user