MCPcopy Create free account
hub / github.com/SolarLune/masterplan / SetCountdownTime

Method SetCountdownTime

contents.go:1867–1887  ·  view source on GitHub ↗
(minutes, seconds int)

Source from the content-addressed store, hash-verified

1865}
1866
1867func (tc *TimerContents) SetCountdownTime(minutes, seconds int) string {
1868
1869 if minutes <= 0 && seconds <= 0 {
1870 minutes = 0
1871 seconds = 1
1872 }
1873
1874 for seconds >= 60 {
1875 seconds -= 60
1876 minutes++
1877 }
1878
1879 tc.Card.Properties.Get("max minutes").Set(float64(minutes))
1880 tc.Card.Properties.Get("max seconds").Set(float64(seconds))
1881 tc.CountdownTime = time.Duration((minutes * int(time.Minute)) + (seconds * int(time.Second)))
1882
1883 tc.UpdateTargetTimerText()
1884
1885 return tc.TargetTimeLabel.TextAsString()
1886
1887}
1888
1889func (tc *TimerContents) SetScheduleTime(hour, minute int) string {
1890

Callers 2

NewTimerContentsFunction · 0.95
OpenProjectFromFunction · 0.80

Calls 4

UpdateTargetTimerTextMethod · 0.95
TextAsStringMethod · 0.80
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected