Documentation
¶
Index ¶
- type DatePicker
- type DatesMode
- type LangsData
- type OnCancelHandler
- type OnErrorHandler
- type OnSelectHandler
- type Option
- func CurrentDate(current time.Time) Option
- func Dates(datesMode DatesMode, dates []time.Time) Option
- func From(from time.Time) Option
- func Language(lang string) Option
- func Languages(langs LangsData) Option
- func NoDeleteAfterCancel() Option
- func NoDeleteAfterSelect() Option
- func OnCancel(f OnCancelHandler) Option
- func OnError(f OnErrorHandler) Option
- func StartFromSunday() Option
- func To(to time.Time) Option
- func WithPrefix(s string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatePicker ¶
type DatePicker struct {
// contains filtered or unexported fields
}
func New ¶
func New(b *bot.Bot, onSelect OnSelectHandler, opts ...Option) *DatePicker
func (*DatePicker) MarshalJSON ¶
func (datePicker *DatePicker) MarshalJSON() ([]byte, error)
func (*DatePicker) Prefix ¶ added in v0.3.1
func (datePicker *DatePicker) Prefix() string
Prefix returns the prefix of the widget
type LangsData ¶
LangsData contains all languages data key is language code, value is language data with key:value pairs
type OnCancelHandler ¶
type OnErrorHandler ¶
type OnErrorHandler func(err error)
type OnSelectHandler ¶
type Option ¶
type Option func(dp *DatePicker)
func Languages ¶
Languages sets the languages of the datepicker. All supported keys you can see in langs.json file
func NoDeleteAfterCancel ¶ added in v0.3.2
func NoDeleteAfterCancel() Option
NoDeleteAfterCancel is a keyboard option that prevents the hide keyboard after cancel
func NoDeleteAfterSelect ¶ added in v0.3.2
func NoDeleteAfterSelect() Option
NoDeleteAfterSelect is a keyboard option that prevents the hide keyboard after select
func OnCancel ¶
func OnCancel(f OnCancelHandler) Option
OnCancel sets the callback function for the cancel button.
func OnError ¶
func OnError(f OnErrorHandler) Option
OnError sets the callback function for the error.
func StartFromSunday ¶
func StartFromSunday() Option
StartFromSunday sets the first day of the week to Sunday.
func WithPrefix ¶ added in v0.3.1
WithPrefix is a keyboard option that sets a prefix for the widget