0%

Date picker

A date picker is a widget that allows users to select a year, month, and day (core.DatePicker).

Also see a time picker that allows users to select an hour and minute, a unified time input that allows users to select both a date and time using text fields and dialogs, and a duration input.

Properties

You can make a date picker and set its starting value:

core.NewDatePicker(b).SetTime(time.Now())

Events

You can detect when a user changes the date:

dp := core.NewDatePicker(b).SetTime(time.Now())
dp.OnChange(func(e events.Event) {
    core.MessageSnackbar(dp, dp.Time.Format("1/2/2006"))
})