Class DateTimePicker (2.40.0)

public final class DateTimePicker extends GeneratedMessageV3 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

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

LABEL_FIELD_NUMBER

public static final int LABEL_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

ON_CHANGE_ACTION_FIELD_NUMBER

public static final int ON_CHANGE_ACTION_FIELD_NUMBER
Field Value
Type Description
int

TIMEZONE_OFFSET_DATE_FIELD_NUMBER

public static final int TIMEZONE_OFFSET_DATE_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

VALUE_MS_EPOCH_FIELD_NUMBER

public static final int VALUE_MS_EPOCH_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static DateTimePicker getDefaultInstance()
Returns
Type Description
DateTimePicker

getDescriptor()

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

newBuilder()

public static DateTimePicker.Builder newBuilder()
Returns
Type Description
DateTimePicker.Builder

newBuilder(DateTimePicker prototype)

public static DateTimePicker.Builder newBuilder(DateTimePicker prototype)
Parameter
Name Description
prototype DateTimePicker
Returns
Type Description
DateTimePicker.Builder

parseDelimitedFrom(InputStream input)

public static DateTimePicker parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DateTimePicker
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DateTimePicker parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static DateTimePicker parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
DateTimePicker
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DateTimePicker parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DateTimePicker parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
DateTimePicker
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DateTimePicker parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DateTimePicker parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
DateTimePicker
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DateTimePicker parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static DateTimePicker parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DateTimePicker
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DateTimePicker parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static DateTimePicker parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
DateTimePicker
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DateTimePicker parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DateTimePicker
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<DateTimePicker> parser()
Returns
Type Description
Parser<DateTimePicker>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public DateTimePicker getDefaultInstanceForType()
Returns
Type Description
DateTimePicker

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.

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

getParserForType()

public Parser<DateTimePicker> getParserForType()
Returns
Type Description
Parser<DateTimePicker>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public DateTimePicker.Builder newBuilderForType()
Returns
Type Description
DateTimePicker.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DateTimePicker.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
DateTimePicker.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public DateTimePicker.Builder toBuilder()
Returns
Type Description
DateTimePicker.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException