Documentation
¶
Index ¶
- Constants
- func FromString(value string) (datetime.Interface, error)
- func New(hour, minute, second int) (datetime.Interface, error)
- 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 Time
- func (t *Time) After(u datetime.Interface) bool
- func (t *Time) Before(u datetime.Interface) bool
- func (t *Time) Between(start, end datetime.Interface) bool
- func (t *Time) Compare(u datetime.Interface) int
- func (t *Time) Equal(u datetime.Interface) bool
- func (t *Time) FromString(value string) (datetime.Interface, error)
- func (t *Time) Time() goTime.Time
- func (t *Time) ToString() string
- type Value
Constants ¶
View Source
const ( Regexp = `^(\d{2}):(\d{2}):(\d{2})?$` DateRegexp = datetime.YearRegexp + `-` + datetime.MonthRegexp + `-` + datetime.DayRegexp TimeRegexp = `(` + datetime.HourRegexp + `):(` + datetime.MinuteRegexp + `):(` + datetime.SecondRegexp + `)` DateTimeRegexp = `((` + DateRegexp + `)?\s*(` + TimeRegexp + `))` )
View Source
const (
RangeRegexp = `^([\[\(])` + DateTimeRegexp + `?\s*,\s*` + DateTimeRegexp + `?([\]\)])$`
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func NewRangeOptional ¶
func NewRangeStartOptional ¶
func NewRangeStartStrict ¶
func NewRangeStrict ¶
func RangeFromString ¶
func (*Range) From ¶
func (d *Range) From() datetime.ValueInterface
func (*Range) Start ¶
func (d *Range) Start() datetime.RangeStart
func (*Range) To ¶
func (d *Range) To() datetime.ValueInterface
type Time ¶
type Time struct {
Hour int `validate:"min=0,max=23"`
Minute int `validate:"min=0,max=59"`
Second int `validate:"min=0,max=59"`
DateTime goTime.Time
}
Click to show internal directories.
Click to hide internal directories.