Skip to content

Commit

Permalink
improve timestamp detection
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Oct 18, 2023
1 parent 6e11bd3 commit b8fd9a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
regexp.MustCompile(`\d{2}-\d{2}-\d{4}`),
regexp.MustCompile(`\d{2}/\d{2}/\d{4}`),
regexp.MustCompile(`\d{2}\.\d{2}\.\d{4}`),
regexp.MustCompile(`\d{2}/[A-Z][a-z]{2}/\d{4}`),
}
)

Expand Down
1 change: 1 addition & 0 deletions timestamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ func Test_containsTimestamp(t *testing.T) {
assert.True(t, containsTimestamp("2005-08-09T18:31:42-03:30"))
assert.True(t, containsTimestamp("2005-08-09T18:31:42"))
assert.True(t, containsTimestamp("2005-08-09T18:31:42.201"))
assert.True(t, containsTimestamp(`10/Oct/2000:13:55:36 -0700`))
}

0 comments on commit b8fd9a7

Please sign in to comment.