Documentation
¶
Overview ¶
Package types provides shared types used across the Basecamp SDK.
Index ¶
- type Date
- func (d Date) AddDays(n int) Date
- func (d Date) AddMonths(n int) Date
- func (d Date) AddYears(n int) Date
- func (d Date) After(other Date) bool
- func (d Date) Before(other Date) bool
- func (d Date) Compare(other Date) int
- func (d Date) DaysSince(s Date) int
- func (d Date) Equal(other Date) bool
- func (d Date) GoString() string
- func (d Date) In(loc *time.Location) time.Time
- func (d Date) IsValid() bool
- func (d Date) IsZero() bool
- func (d Date) MarshalJSON() ([]byte, error)
- func (d Date) MarshalText() ([]byte, error)
- func (d Date) String() string
- func (d Date) UTC() time.Time
- func (d *Date) UnmarshalJSON(data []byte) error
- func (d *Date) UnmarshalText(data []byte) error
- func (d Date) Weekday() time.Weekday
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date struct {
Year int // Year (e.g., 2024)
Month time.Month // Month of the year (January = 1, ...)
Day int // Day of the month, starting at 1
}
Date represents a calendar date (year, month, day) without time or timezone. Use this for date-only fields like due_on and starts_on.
func (Date) Compare ¶
Compare compares d and other. Returns -1 if d < other, 0 if equal, +1 if d > other.
func (Date) In ¶
In returns the time.Time corresponding to midnight of the date in the given location.
func (Date) MarshalJSON ¶
MarshalJSON implements json.Marshaler. Zero dates marshal as null, valid dates as "YYYY-MM-DD".
func (Date) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. Accepts "YYYY-MM-DD" strings and null.
func (*Date) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.