pub struct DateTimePicker {
pub name: String,
pub label: String,
pub type: i32,
pub value_ms_epoch: i64,
pub timezone_offset_date: i32,
pub on_change_action: Option<Action>,
}
Expand description
Lets users input a date, a time, or both a date and a time. For an example in Google Chat apps, see Let a user pick a date and time.
Users can input text or use the picker to select dates and times. If users input an invalid date or time, the picker shows an error that prompts users to input the information correctly.
Fields§
§name: String
The name by which the DateTimePicker
is identified in a form input event.
For details about working with form inputs, see Receive form data.
label: String
The text that prompts users to input a date, a time, or a date and time.
For example, if users are scheduling an appointment, use a label such as
Appointment date
or Appointment date and time
.
type: i32
Whether the widget supports inputting a date, a time, or the date and time.
value_ms_epoch: i64
The default value displayed in the widget, in milliseconds since Unix epoch time.
Specify the value based on the type of picker (DateTimePickerType
):
DATE_AND_TIME
: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use1672574400000
.DATE_ONLY
: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use1672531200000
.TIME_ONLY
: a time in UTC. For example, to represent 12:00 PM, use43200000
(or12 * 60 * 60 * 1000
).
timezone_offset_date: i32
The number representing the time zone offset from UTC, in minutes.
If set, the value_ms_epoch
is displayed in the specified time zone.
If unset, the value defaults to the user’s time zone setting.
on_change_action: Option<Action>
Triggered when the user clicks Save or Clear from the
DateTimePicker
interface.
Implementations§
Source§impl DateTimePicker
impl DateTimePicker
Sourcepub fn type(&self) -> DateTimePickerType
pub fn type(&self) -> DateTimePickerType
Returns the enum value of type
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_type(&mut self, value: DateTimePickerType)
pub fn set_type(&mut self, value: DateTimePickerType)
Sets type
to the provided enum value.
Trait Implementations§
Source§impl Clone for DateTimePicker
impl Clone for DateTimePicker
Source§fn clone(&self) -> DateTimePicker
fn clone(&self) -> DateTimePicker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DateTimePicker
impl Debug for DateTimePicker
Source§impl Default for DateTimePicker
impl Default for DateTimePicker
Source§fn default() -> DateTimePicker
fn default() -> DateTimePicker
Source§impl Message for DateTimePicker
impl Message for DateTimePicker
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for DateTimePicker
impl PartialEq for DateTimePicker
impl StructuralPartialEq for DateTimePicker
Auto Trait Implementations§
impl Freeze for DateTimePicker
impl RefUnwindSafe for DateTimePicker
impl Send for DateTimePicker
impl Sync for DateTimePicker
impl Unpin for DateTimePicker
impl UnwindSafe for DateTimePicker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request