diff --git a/internal/adapter/handlebars/handlebars_test.go b/internal/adapter/handlebars/handlebars_test.go index d7931ec8..3a806ec4 100644 --- a/internal/adapter/handlebars/handlebars_test.go +++ b/internal/adapter/handlebars/handlebars_test.go @@ -238,8 +238,11 @@ func TestFormatDateHelper(t *testing.T) { testString(t, "{{format-date now 'timestamp'}}", context, "200911172034") testString(t, "{{format-date now 'timestamp-unix'}}", context, "1258490098") testString(t, "{{format-date now 'cust: %Y-%m'}}", context, "cust: 2009-11") +} + +func TestFormatDateHelperElapsedYear(t *testing.T) { year := time.Now().UTC().Year() - 14 - context = map[string]interface{}{"now": time.Date(year, 11, 17, 20, 34, 58, 651387237, time.UTC)} + context := map[string]interface{}{"now": time.Date(year, 11, 17, 20, 34, 58, 651387237, time.UTC)} testString(t, "{{format-date now 'elapsed'}}", context, "14 years ago") }