Versions in this module Expand all Collapse all v0 v0.1.2 Apr 28, 2021 v0.1.1 Apr 28, 2021 Changes in this version + const Armed + const Day + const Hour + const Minute + const Month + const Second + const Set + const Unready + const Week + const Year + var PeriodDayNames = plural.FromZero("%v days", "%v day", "%v days") + var PeriodHourNames = plural.FromZero("", "%v hour", "%v hours") + var PeriodMinuteNames = plural.FromZero("", "%v minute", "%v minutes") + var PeriodMonthNames = plural.FromZero("", "%v month", "%v months") + var PeriodSecondNames = plural.FromZero("", "%v second", "%v seconds") + var PeriodWeekNames = plural.FromZero("", "%v week", "%v weeks") + var PeriodYearNames = plural.FromZero("", "%v year", "%v years") + type Period struct + func Between(t1, t2 time.Time) (p Period) + func MustParse(value string, normalise ...bool) Period + func New(years, months, days, hours, minutes, seconds int) Period + func NewHMS(hours, minutes, seconds int) Period + func NewOf(duration time.Duration) (p Period, precise bool) + func NewYMD(years, months, days int) Period + func Parse(period string, normalise ...bool) (Period, error) + func ParseWithNormalise(period string, normalise bool) (Period, error) + func (p Period) Add(that Period) Period + func (p Period) AddTo(t time.Time) (time.Time, bool) + func (p Period) Scale(factor float32) Period + func (p Period) ScaleWithOverflowCheck(factor float32) (Period, error) + func (period *Period) Scan(value interface{}) (err error) + func (period *Period) Set(p string) error + func (period *Period) UnmarshalBinary(data []byte) error + func (period *Period) UnmarshalText(data []byte) (err error) + func (period Period) Abs() Period + func (period Period) Days() int + func (period Period) DaysFloat() float32 + func (period Period) Duration() (time.Duration, bool) + func (period Period) DurationApprox() time.Duration + func (period Period) Format() string + func (period Period) FormatWithPeriodNames(...) string + func (period Period) FormatWithoutWeeks() string + func (period Period) Hours() int + func (period Period) HoursFloat() float32 + func (period Period) IsNegative() bool + func (period Period) IsPositive() bool + func (period Period) IsZero() bool + func (period Period) MarshalBinary() ([]byte, error) + func (period Period) MarshalText() ([]byte, error) + func (period Period) Minutes() int + func (period Period) MinutesFloat() float32 + func (period Period) ModuloDays() int + func (period Period) Months() int + func (period Period) MonthsFloat() float32 + func (period Period) Negate() Period + func (period Period) Normalise(precise bool) Period + func (period Period) OnlyHMS() Period + func (period Period) OnlyYMD() Period + func (period Period) Seconds() int + func (period Period) SecondsFloat() float32 + func (period Period) Sign() int + func (period Period) Simplify(precise bool, th ...int) Period + func (period Period) String() string + func (period Period) TotalDaysApprox() int + func (period Period) TotalMonthsApprox() int + func (period Period) Type() string + func (period Period) Value() (driver.Value, error) + func (period Period) Weeks() int + func (period Period) WeeksFloat() float32 + func (period Period) Years() int + func (period Period) YearsFloat() float32