Documentation
¶
Overview ¶
Package datex is a wrapper around github.com/rickb777/date/v2 and github.com/rickb777/period so we don't depend on it directly.
Index ¶
- Constants
- type Period
- func (p Period) Add(p2 Period) (Period, error)
- func (p Period) DivisibleBy(smaller Period) (bool, error)
- func (p *Period) Equal(v *Period) bool
- func (p Period) ISOString() String
- func (d *Period) ISOStringPtrOrNil() *String
- func (p Period) InHours(daysInMonth int) (alpacadecimal.Decimal, error)
- func (p Period) Normalise(exact bool) Period
- func (p Period) Simplify(exact bool) Period
- func (p Period) Subtract(p2 Period) (Period, error)
- type String
Constants ¶
View Source
const MAX_SAFE_ITERATION_COUNT = 1_000_000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Period ¶
func FromDuration ¶
FromDuration creates an IMPRECISE Period from a time.Duration
func (Period) DivisibleBy ¶
DivisibleBy returns true if the period is divisible by the smaller period (in hours).
func (*Period) ISOStringPtrOrNil ¶
ISOStringPtrOrNil() returns the ISO8601 string representation of the period or if Period is nil, returns nil
type String ¶
func (*String) ParsePtrOrNil ¶
ParsePtrOrNil parses the ISO8601 string representation of the period or if ISOString is nil, returns nil
Click to show internal directories.
Click to hide internal directories.