123456789101112131415161718192021222324252627282930 |
- 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,
- }
- }
|