mirror of
https://github.com/samsonjs/retrogit.git
synced 2026-03-25 09:25:49 +00:00
Defeat Gmail's date detection in the interval summary string.
This commit is contained in:
parent
abb4822197
commit
79462eed54
1 changed files with 8 additions and 2 deletions
|
|
@ -14,7 +14,8 @@ import (
|
|||
const (
|
||||
CommitDisplayDateFormat = "3:04pm"
|
||||
CommitDisplayDateTooltipFormat = "Monday January 2 3:04pm"
|
||||
DigestDisplayDateFormat = "January 2, 2006 was a Monday"
|
||||
DigestDisplayDateFormat = "January 2, 2006"
|
||||
DigestDisplayDayOfWeekFormat = "Monday"
|
||||
)
|
||||
|
||||
type DigestCommit struct {
|
||||
|
|
@ -115,8 +116,13 @@ func (digest *IntervalDigest) Description() string {
|
|||
} else {
|
||||
formattedRepoCount = fmt.Sprintf("%d repositories", repoCount)
|
||||
}
|
||||
return fmt.Sprintf("%s. You had %s in %s that day.",
|
||||
dayOfWeek := digest.StartTime.Format(DigestDisplayDayOfWeekFormat)
|
||||
// Insert a zero-width space inside the day of the week so that Gmail's
|
||||
// event detection doesn't pick it up.
|
||||
dayOfWeek = fmt.Sprintf("%s\u200B%s", dayOfWeek[:1], dayOfWeek[1:])
|
||||
return fmt.Sprintf("%s was a %s. You had %s in %s that day.",
|
||||
digest.StartTime.Format(DigestDisplayDateFormat),
|
||||
dayOfWeek,
|
||||
formattedCommitCount,
|
||||
formattedRepoCount)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue