Documentation
¶
Index ¶
- Constants
- func FromString(value string) (datetime.Interface, error)
- func New(year, month, day int) (datetime.Interface, error)
- type Date
- func (d *Date) After(u datetime.Interface) bool
- func (d *Date) Before(u datetime.Interface) bool
- func (d *Date) Between(start, end datetime.Interface) bool
- func (d *Date) Compare(u datetime.Interface) int
- func (d *Date) Equal(u datetime.Interface) bool
- func (d *Date) FromString(value string) (datetime.Interface, error)
- func (d *Date) IsWeekend() bool
- func (d *Date) Time() time.Time
- func (d *Date) ToString() string
- type Range
- func NewRange(from, to string, start datetime.RangeStart, end datetime.RangeEnd) (*Range, error)
- func NewRangeOptional(from, to string) (*Range, error)
- func NewRangeStartOptional(from, to string) (*Range, error)
- func NewRangeStartStrict(from, to string) (*Range, error)
- func NewRangeStrict(from, to string) (*Range, error)
- func RangeFromString(dateRange string) (*Range, error)
- type Value
Constants ¶
View Source
const ( Regexp = `^(\d{4})-(\d{2})-(\d{2})?$` DateTimeRegexp = `^(((\d{4})-(\d{2})-(\d{2}))( )?)((\d{2}):(\d{2}):(\d{2}))?$` )
View Source
const ( RangeDateRegexp = `(` + datetime.YearRegexp + `-` + datetime.MonthRegexp + `-` + datetime.DayRegexp + `)` RangeRegexp = `^([\[\(])` + RangeDateRegexp + `?\s*,\s*` + RangeDateRegexp + `?([\]\)])$` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Date ¶
type Date struct {
Year int
Month int `validate:"min=1,max=12"`
Day int `validate:"min=1,max=31"`
DateTime time.Time
}
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func NewRangeOptional ¶
func NewRangeStartOptional ¶
func NewRangeStartStrict ¶
func NewRangeStrict ¶
func RangeFromString ¶
func (*Range) Start ¶
func (d *Range) Start() datetime.RangeStart
Click to show internal directories.
Click to hide internal directories.