Class DateTimePicker.Builder (2.37.1)

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 Date time picker.

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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DateTimePicker.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
DateTimePicker.Builder
Overrides

build()

public DateTimePicker build()
Returns
TypeDescription
DateTimePicker

buildPartial()

public DateTimePicker buildPartial()
Returns
TypeDescription
DateTimePicker

clear()

public DateTimePicker.Builder clear()
Returns
TypeDescription
DateTimePicker.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public DateTimePicker.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
DateTimePicker.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public DateTimePicker.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
DateTimePicker.Builder

This builder for chaining.

clone()

public DateTimePicker.Builder clone()
Returns
TypeDescription
DateTimePicker.Builder
Overrides

getDefaultInstanceForType()

public DateTimePicker getDefaultInstanceForType()
Returns
TypeDescription
DateTimePicker

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the onChangeAction field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(DateTimePicker other)

public DateTimePicker.Builder mergeFrom(DateTimePicker other)
Parameter
NameDescription
otherDateTimePicker
Returns
TypeDescription
DateTimePicker.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DateTimePicker.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DateTimePicker.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public DateTimePicker.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueAction
Returns
TypeDescription
DateTimePicker.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DateTimePicker.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DateTimePicker.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public DateTimePicker.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The label to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for label to set.

Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
valueAction
Returns
TypeDescription
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
NameDescription
builderForValueAction.Builder
Returns
TypeDescription
DateTimePicker.Builder

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

public DateTimePicker.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueint

The timezoneOffsetDate to set.

Returns
TypeDescription
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
NameDescription
valueDateTimePicker.DateTimePickerType

The type to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
DateTimePicker.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DateTimePicker.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valuelong

The valueMsEpoch to set.

Returns
TypeDescription
DateTimePicker.Builder

This builder for chaining.