date_time_range

package
v0.0.0-...-e165f0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DateTimeRange

type DateTimeRange struct {
	// DateTime at which the date range begins. If unset, the range has no
	// beginning bound.
	Start *datetime.DateTime `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"`
	// DateTime at which the date range ends. If unset, the range has no ending
	// bound.
	End                  *datetime.DateTime `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

Represents a date and time range. This can represent:

  • A range between points in time with time zone or offset, e.g. the duration of a flight which starts in the "America/New_York" time zone and ends in the "Australia/Sydney" time zone
  • A range between points in time without time zone/offset info, e.g. an appointment in local time
  • A range starting at a specific date and time, e.g. the range of time which can be measured in milliseconds since the Unix epoch (period starting with 1970-01-01T00:00:00Z)
  • A range ending at a specific date and time, e.g. range of time before a deadline

When considering whether a DateTime falls within a DateTimeRange, the start of the range is inclusive and the end is exclusive.

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

When both start and end are set, either both or neither must have a time_offset. When set, time_offset can be specified by either utc_offset or time_zone and must match for start and end, that is if start has utc_offset set then end must also have utc_offset set. The values of utc_offset or time_zone need not be the same for start and end.

When both start and end are set, start must be chronologically less than or equal to end. When start and end are equal, the range is empty.

The semantics of start and end are the same as those of [google.type.DateTime][google.type.DateTime].

func (*DateTimeRange) Descriptor

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

func (*DateTimeRange) GetEnd

func (m *DateTimeRange) GetEnd() *datetime.DateTime

func (*DateTimeRange) GetStart

func (m *DateTimeRange) GetStart() *datetime.DateTime

func (*DateTimeRange) ProtoMessage

func (*DateTimeRange) ProtoMessage()

func (*DateTimeRange) Reset

func (m *DateTimeRange) Reset()

func (*DateTimeRange) String

func (m *DateTimeRange) String() string

func (*DateTimeRange) XXX_DiscardUnknown

func (m *DateTimeRange) XXX_DiscardUnknown()

func (*DateTimeRange) XXX_Marshal

func (m *DateTimeRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DateTimeRange) XXX_Merge

func (m *DateTimeRange) XXX_Merge(src proto.Message)

func (*DateTimeRange) XXX_Size

func (m *DateTimeRange) XXX_Size() int

func (*DateTimeRange) XXX_Unmarshal

func (m *DateTimeRange) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL