zenity/date.go

23 lines
527 B
Go
Raw Normal View History

2021-04-11 22:02:21 -04:00
package zenity
import (
"time"
)
// Calendar displays the calendar dialog.
//
// Valid options: Title, Width, Height, OKLabel, CancelLabel, ExtraButton,
2022-03-28 15:22:39 -04:00
// Icon, DefaultDate.
//
// May return: ErrCanceled.
2021-04-11 22:02:21 -04:00
func Calendar(text string, options ...Option) (time.Time, error) {
return calendar(text, applyOptions(options))
}
// DefaultDate returns an Option to set the date.
func DefaultDate(year int, month time.Month, day int) Option {
return funcOption(func(o *options) {
2022-03-28 15:22:39 -04:00
o.year, o.month, o.day = &year, month, day
2021-04-11 22:02:21 -04:00
})
}