MCPcopy
hub / github.com/lxn/walk / SetFormat

Method SetFormat

datelabel.go:97–114  ·  view source on GitHub ↗
(format string)

Source from the content-addressed store, hash-verified

95}
96
97func (dl *DateLabel) SetFormat(format string) error {
98 if format == dl.format {
99 return nil
100 }
101
102 old := dl.format
103
104 dl.format = format
105
106 if _, err := dl.updateText(); err != nil {
107 dl.format = old
108 return err
109 }
110
111 dl.formatChangedPublisher.Publish()
112
113 return nil
114}
115
116func (dl *DateLabel) updateText() (changed bool, err error) {
117 return dl.setText(dl.date.Format(dl.format))

Callers 1

NewDateLabelFunction · 0.45

Calls 2

updateTextMethod · 0.95
PublishMethod · 0.45

Tested by

no test coverage detected