From 79462eed544f3fb5d513ce7c0d16d576454bf3ea Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Sat, 6 Sep 2014 14:39:57 -0700 Subject: [PATCH] Defeat Gmail's date detection in the interval summary string. --- app/digest.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/digest.go b/app/digest.go index f65dfe8..b24bc77 100644 --- a/app/digest.go +++ b/app/digest.go @@ -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) }