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