package date_range

import "google.golang.org/genproto/googleapis/type/date_range"

Index

Variables

var File_google_actions_type_date_range_proto protoreflect.FileDescriptor

Types

type DateRange

type DateRange struct {

	// Date at which the date range begins. If unset, the date range has no
	// beginning bound.
	Start *date.Date `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"`
	// Date at which the date range ends. If unset, the date range has no ending
	// bound.
	End *date.Date `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

Represents a range based on whole or partial calendar dates, e.g. the duration of a hotel reservation or the Common Era. This can represent:

* A range between full dates, e.g. the duration of a hotel reservation * A range between years, e.g. a historical era * A range between year/month dates, e.g. the duration of a job on a resume * A range beginning in a year, e.g. the Common Era * A range ending on a specific date, e.g. the period of time before an event

While [google.type.Date][google.type.Date] allows zero years, DateRange does not. Year must always be non-zero.

End cannot be chronologically before start. For example, if start has year 2000, end cannot have year 1999.

When both set, start and end must have exactly the same precision. That is, they must have the same fields populated with non-zero values. For example, if start specifies only year and month, then end must also specify only year and month (but not day).

The date range is inclusive. That is, the dates specified by start and end are part of the date range. For example, the date January 1, 2000 falls within any date with start or end equal to January 1, 2000. When determining whether a date is inside a date range, the date should only be compared to start and end when those values are set.

When a date and date range are specified to different degrees of precision, the rules for evaluating whether that date is inside the date range are as follows:

The semantics of start and end are the same as those of [google.type.Date][google.type.Date], except that year must always be non-zero in DateRange.

func (*DateRange) Descriptor

func (*DateRange) Descriptor() ([]byte, []int)

Deprecated: Use DateRange.ProtoReflect.Descriptor instead.

func (*DateRange) GetEnd

func (x *DateRange) GetEnd() *date.Date

func (*DateRange) GetStart

func (x *DateRange) GetStart() *date.Date

func (*DateRange) ProtoMessage

func (*DateRange) ProtoMessage()

func (*DateRange) ProtoReflect

func (x *DateRange) ProtoReflect() protoreflect.Message

func (*DateRange) Reset

func (x *DateRange) Reset()

func (*DateRange) String

func (x *DateRange) String() string

Source Files

date_range.pb.go

Version
v0.0.0-20250219182151-9fdb1cabc7b2 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
1 hour ago

Tools for package owners.