package tfelem import ( "git.swzry.com/zry/YAGTF/yagtf/utils" "strconv" "time" ) type YearDayElement struct { Fill bool } func (this *YearDayElement) ExpectedSize() int { return 2 } func (this *YearDayElement) PrintElement(t time.Time) string { if this.Fill { return utils.GetFilledNumberWithTruncate(t.YearDay(), 3) } else { return strconv.Itoa(t.YearDay()) } } func NewYearDayElement(fill bool) *YearDayElement { return &YearDayElement{ Fill: fill, } }