DatePicker

A view displays date and time with editing ability.

Header#include "nativeui/date_picker.h"
Namespacenamespace nu
Typeclass (RefCounted)
InheritsView

Constructors

DatePicker(const DatePicker::Options& options)

Create a new DatePicker with options.

Parameters

Class properties

const char* kClassName

The class name of this view.

Methods

void SetDate(const base::Time& time)

Set the selected date to time.

Parameters

base::Time GetDate() const

Get the selected date.

Return

base::Time

void SetRange(const absl::optional<base::Time>& minimum, const absl::optional<base::Time>& maximum)

Set the minimum and maximum date values.

Parameters

std::tuple<absl::optional<base::Time>, absl::optional<base::Time>> GetRange() const

Return the minimum and maximum date values.

Return

std::tuple<absl::optional<base::Time>, absl::optional<base::Time>>

bool HasStepper() const

Return whether there is a stepper attached to the text field.

Return

bool

Events

void on_date_change(DatePicker* self)

Emitted when the selected date has been changed.

Parameters

Preventable

No.