Class DateTimePicker.Builder (2.40.0)

public static final class DateTimePicker.Builder extends GeneratedMessageV3.Builder<DateTimePicker.Builder> implements DateTimePickerOrBuilder

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.

Google Workspace Add-ons and Chat apps:

Protobuf type google.apps.card.v1.DateTimePicker

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DateTimePicker.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DateTimePicker.Builder
Overrides

build()

public DateTimePicker build()
Returns
Type Description
DateTimePicker

buildPartial()

public DateTimePicker buildPartial()
Returns
Type Description
DateTimePicker

clear()

public DateTimePicker.Builder clear()
Returns
Type Description
DateTimePicker.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public DateTimePicker.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
DateTimePicker.Builder
Overrides

clearLabel()

public DateTimePicker.Builder clearLabel()

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.

string label = 2;

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

clearName()

public DateTimePicker.Builder clearName()

The name by which the DateTimePicker is identified in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

clearOnChangeAction()

public DateTimePicker.Builder clearOnChangeAction()

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Returns
Type Description
DateTimePicker.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public DateTimePicker.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
DateTimePicker.Builder
Overrides

clearTimezoneOffsetDate()

public DateTimePicker.Builder clearTimezoneOffsetDate()

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.

int32 timezone_offset_date = 5;

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

clearType()

public DateTimePicker.Builder clearType()

Whether the widget supports inputting a date, a time, or the date and time.

.google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3;

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

clearValueMsEpoch()

public DateTimePicker.Builder clearValueMsEpoch()

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, use 1672574400000.
  • DATE_ONLY: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use 1672531200000.
  • TIME_ONLY: a time in UTC. For example, to represent 12:00 PM, use 43200000 (or 12 * 60 * 60 * 1000).

int64 value_ms_epoch = 4;

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

clone()

public DateTimePicker.Builder clone()
Returns
Type Description
DateTimePicker.Builder
Overrides

getDefaultInstanceForType()

public DateTimePicker getDefaultInstanceForType()
Returns
Type Description
DateTimePicker

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLabel()

public String getLabel()

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.

string label = 2;

Returns
Type Description
String

The label.

getLabelBytes()

public ByteString getLabelBytes()

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.

string label = 2;

Returns
Type Description
ByteString

The bytes for label.

getName()

public String getName()

The name by which the DateTimePicker is identified in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name by which the DateTimePicker is identified in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getOnChangeAction()

public Action getOnChangeAction()

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Returns
Type Description
Action

The onChangeAction.

getOnChangeActionBuilder()

public Action.Builder getOnChangeActionBuilder()

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Returns
Type Description
Action.Builder

getOnChangeActionOrBuilder()

public ActionOrBuilder getOnChangeActionOrBuilder()

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Returns
Type Description
ActionOrBuilder

getTimezoneOffsetDate()

public int getTimezoneOffsetDate()

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.

int32 timezone_offset_date = 5;

Returns
Type Description
int

The timezoneOffsetDate.

getType()

public DateTimePicker.DateTimePickerType getType()

Whether the widget supports inputting a date, a time, or the date and time.

.google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3;

Returns
Type Description
DateTimePicker.DateTimePickerType

The type.

getTypeValue()

public int getTypeValue()

Whether the widget supports inputting a date, a time, or the date and time.

.google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3;

Returns
Type Description
int

The enum numeric value on the wire for type.

getValueMsEpoch()

public long getValueMsEpoch()

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, use 1672574400000.
  • DATE_ONLY: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use 1672531200000.
  • TIME_ONLY: a time in UTC. For example, to represent 12:00 PM, use 43200000 (or 12 * 60 * 60 * 1000).

int64 value_ms_epoch = 4;

Returns
Type Description
long

The valueMsEpoch.

hasOnChangeAction()

public boolean hasOnChangeAction()

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Returns
Type Description
boolean

Whether the onChangeAction field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(DateTimePicker other)

public DateTimePicker.Builder mergeFrom(DateTimePicker other)
Parameter
Name Description
other DateTimePicker
Returns
Type Description
DateTimePicker.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DateTimePicker.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public DateTimePicker.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
DateTimePicker.Builder
Overrides

mergeOnChangeAction(Action value)

public DateTimePicker.Builder mergeOnChangeAction(Action value)

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Parameter
Name Description
value Action
Returns
Type Description
DateTimePicker.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DateTimePicker.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DateTimePicker.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public DateTimePicker.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DateTimePicker.Builder
Overrides

setLabel(String value)

public DateTimePicker.Builder setLabel(String value)

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.

string label = 2;

Parameter
Name Description
value String

The label to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setLabelBytes(ByteString value)

public DateTimePicker.Builder setLabelBytes(ByteString value)

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.

string label = 2;

Parameter
Name Description
value ByteString

The bytes for label to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setName(String value)

public DateTimePicker.Builder setName(String value)

The name by which the DateTimePicker is identified in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setNameBytes(ByteString value)

public DateTimePicker.Builder setNameBytes(ByteString value)

The name by which the DateTimePicker is identified in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setOnChangeAction(Action value)

public DateTimePicker.Builder setOnChangeAction(Action value)

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Parameter
Name Description
value Action
Returns
Type Description
DateTimePicker.Builder

setOnChangeAction(Action.Builder builderForValue)

public DateTimePicker.Builder setOnChangeAction(Action.Builder builderForValue)

Triggered when the user clicks Save or Clear from the DateTimePicker interface.

.google.apps.card.v1.Action on_change_action = 6;

Parameter
Name Description
builderForValue Action.Builder
Returns
Type Description
DateTimePicker.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public DateTimePicker.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
DateTimePicker.Builder
Overrides

setTimezoneOffsetDate(int value)

public DateTimePicker.Builder setTimezoneOffsetDate(int value)

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.

int32 timezone_offset_date = 5;

Parameter
Name Description
value int

The timezoneOffsetDate to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setType(DateTimePicker.DateTimePickerType value)

public DateTimePicker.Builder setType(DateTimePicker.DateTimePickerType value)

Whether the widget supports inputting a date, a time, or the date and time.

.google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3;

Parameter
Name Description
value DateTimePicker.DateTimePickerType

The type to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setTypeValue(int value)

public DateTimePicker.Builder setTypeValue(int value)

Whether the widget supports inputting a date, a time, or the date and time.

.google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3;

Parameter
Name Description
value int

The enum numeric value on the wire for type to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DateTimePicker.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DateTimePicker.Builder
Overrides

setValueMsEpoch(long value)

public DateTimePicker.Builder setValueMsEpoch(long value)

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, use 1672574400000.
  • DATE_ONLY: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use 1672531200000.
  • TIME_ONLY: a time in UTC. For example, to represent 12:00 PM, use 43200000 (or 12 * 60 * 60 * 1000).

int64 value_ms_epoch = 4;

Parameter
Name Description
value long

The valueMsEpoch to set.

Returns
Type Description
DateTimePicker.Builder

This builder for chaining.