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