Documentation ¶
Index ¶
- Constants
- type Date
- func (thisDate Date) DMYWithDots() string
- func (thisDate Date) Day() byte
- func (thisDate *Date) DecodeBinary(_ *pgtype.ConnInfo, src []byte) error
- func (thisDate *Date) DecodeText(_ *pgtype.ConnInfo, src []byte) error
- func (thisDate Date) EncodeBinary(_ *pgtype.ConnInfo, buf []byte) ([]byte, error)
- func (thisDate Date) EncodeText(_ *pgtype.ConnInfo, buf []byte) ([]byte, error)
- func (thisDate Date) Format(layout string) string
- func (thisDate Date) IsFuture() bool
- func (thisDate Date) IsSet() bool
- func (thisDate Date) Month() byte
- func (thisDate Date) MonthAfter(date Date) bool
- func (thisDate Date) MonthBefore(date Date) bool
- func (thisDate Date) NextDay() Date
- func (thisDate Date) NextMonth() Date
- func (thisDate Date) NextWeek() Date
- func (thisDate Date) PreviousDay() Date
- func (thisDate Date) PreviousMonth() Date
- func (thisDate Date) PreviousWeek() Date
- func (thisDate Date) String() string
- func (thisDate Date) Time() *time.Time
- func (thisDate Date) Value() (driver.Value, error)
- func (thisDate Date) Year() uint16
Constants ¶
const ErrUnrecognizedFormat consterrs.Error = "unknown date format"
const (
PostgreSQLFormat = "2006-01-02"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date uint16
Date represents a calendar date starting 2000 year and finishing the year 2127.
func CurrentMonth ¶
func CurrentMonth() Date
func NewDateFromTime ¶
NewDateFromTime create new date using time.Time model.
func (Date) DMYWithDots ¶
DMYWithDots returns date as string in the DD.MM.YYYY format.
func (*Date) DecodeBinary ¶ added in v1.0.4
func (*Date) DecodeText ¶ added in v1.0.4
func (Date) EncodeBinary ¶ added in v1.0.4
func (Date) EncodeText ¶ added in v1.0.4
func (Date) MonthAfter ¶
MonthAfter checks whether the date at least one month after the target date or not.
func (Date) MonthBefore ¶
MonthBefore checks whether the date at least one month before the target date or not.
func (Date) NextMonth ¶
NextMonth returns date which month number in incremented by one. The month number may change greater if the source day does not exist in the next month.
func (Date) PreviousDay ¶
func (Date) PreviousMonth ¶
PreviousMonth returns date which month number in decremented by one. The month number may change greater if the source day does not exist in the previous month.
func (Date) PreviousWeek ¶
func (Date) String ¶
String returns date as string in the default PostgreSQL date format, YYYY-MM-DD.