diff options
| author | John R. Lenton <jlenton@gmail.com> | 2018-03-09 00:23:27 +0100 |
|---|---|---|
| committer | John R. Lenton <jlenton@gmail.com> | 2018-03-09 00:23:27 +0100 |
| commit | d67cc1279489f2704e73c6b1b7e2466f5aee9657 (patch) | |
| tree | 406b688629681f9467f803f31913354bed573592 /timeutil | |
| parent | 3db515cd43e4521859f9825f0f635cc3e51b40c4 (diff) | |
cmd/snap, timeutil: fix issues found in review.
Update --abs-time description (30->60 days), rename 'cutoff' to 'cutoffDays'.
Diffstat (limited to 'timeutil')
| -rw-r--r-- | timeutil/human.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/timeutil/human.go b/timeutil/human.go index 54c43396bf..52a3b58f96 100644 --- a/timeutil/human.go +++ b/timeutil/human.go @@ -39,10 +39,10 @@ func Human(then time.Time) string { return humanTimeSince(then.Local(), time.Now().Local(), 60) } -func humanTimeSince(then, now time.Time, cutoff int) string { +func humanTimeSince(then, now time.Time, cutoffDays int) string { d := int(math.Floor(noon(then).Sub(noon(now)).Hours() / 24)) switch { - case d < -cutoff || d > cutoff: + case d < -cutoffDays || d > cutoffDays: return then.Format("2006-01-02") case d < -1: // TRANSLATORS: %d will be at least 2; the singular is only included to help gettext |
