cal

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateAfter

func DateAfter(date Date) validation.Rule

DateAfter returns a validation rule which checks to ensure the date is *after* the provided date.

func DateBefore

func DateBefore(date Date) validation.Rule

DateBefore is used during validation to ensure the date is before the value passed in.

func DateNotZero

func DateNotZero() validation.Rule

DateNotZero ensures the date is not a zero value.

Types

type Date

type Date struct {
	civil.Date
}

Date represents a simple date without time used most frequently with business documents.

func MakeDate

func MakeDate(year int, month time.Month, day int) Date

MakeDate provides a new date instance.

func NewDate

func NewDate(year int, month time.Month, day int) *Date

NewDate provides a pointer to a new date instance.

func (Date) JSONSchema

func (Date) JSONSchema() *jsonschema.Schema

JSONSchema returns a custom json schema for the date.

type Period

type Period struct {
	Start Date `json:"start"`
	End   Date `json:"end"`
}

Period represents two dates with a start and finish.

func (*Period) Validate

func (p *Period) Validate() error

Validate checks to ensure the period looks correct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL