Documentation ¶
Overview ¶
Package types implements special types for Envelope Zero.
Index ¶
- type Month
- func (m Month) AddDate(years, months int) Month
- func (m Month) After(n Month) bool
- func (m Month) AfterTime(t time.Time) bool
- func (m Month) Before(n Month) bool
- func (m Month) BeforeTime(t time.Time) bool
- func (m Month) Contains(t time.Time) bool
- func (m Month) Equal(n Month) bool
- func (Month) GormDataType() string
- func (m Month) IsZero() bool
- func (m Month) MarshalJSON() ([]byte, error)
- func (m *Month) Scan(value interface{}) (err error)
- func (m Month) String() string
- func (m *Month) UnmarshalJSON(data []byte) error
- func (m Month) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Month ¶
Month is a month in a specific year.
func ParseDateToMonth ¶ added in v3.21.0
ParseDateToMonth parses a string in RFC3339 full-date format and returns the Month value it represents.
func ParseMonth ¶
ParseMonth parses a "YYYY-MM" string and returns the Month value it represents
func (Month) BeforeTime ¶
BeforeTime reports whether the month instant m is before the time instant t.
func (Month) GormDataType ¶
GormDataType defines the data type used by gorm the type.
func (Month) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The output is the result of m.StringRFC3339().
func (*Month) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The month is expected to be a string in a format accepted by ParseDate. From the parsed string, everything is then ignored except the year and month