Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DaysInPeriod ¶
DaysInPeriod calculates amount of days between start and end date (end date excluded).
func PeriodOutside ¶
PeriodOutside retuns true when period a is outside period b including period start and end dates.
func PeriodOverlapsEnd ¶
PeriodOverlapsEnd retuns true when period a ovelaps with the end of period b.
func PeriodOverlapsStart ¶
PeriodOverlapsStart retuns true when period a ovelaps with the start of period b.
func PeriodWithin ¶
PeriodWithin retuns true when period a is within period b including period start and end dates.
Types ¶
type Bill ¶
type Bill struct { Period BillPeriod Due float32 Paid float32 }
Bill describes a bill for a period of time.
func (Bill) BilledDaysIn ¶
BilledDaysIn caclulates how many billed days were in provided period.
type BillPeriod ¶
type BillPeriod struct {
// contains filtered or unexported fields
}
BillPeriod describes date period.
func NewBillPeriod ¶
func NewBillPeriod(periodStart, periodEnd string) (BillPeriod, error)
NewBillPeriod creates a new bill period, start and end dates are in fomat YYYY-MM-DD.
func (BillPeriod) Days ¶
func (p BillPeriod) Days() int
Days calculates amount of days in the period. Start and end dates are counted as part of period.
func (BillPeriod) String ¶
func (p BillPeriod) String() string
type Bills ¶
type Bills []Bill
Bills describes a list of bills.
func (Bills) AmountPaidIn ¶
AmountPaidIn returns amount paid in financial year by the list of bills.
type FinancialYear ¶
type FinancialYear struct {
// contains filtered or unexported fields
}
FinancialYear describes financial year.
func FinancialYearEnding ¶
func FinancialYearEnding(year int) FinancialYear
FinancialYearEnding creates new financial year by ending year.
func FinancialYearStarting ¶
func FinancialYearStarting(year int) FinancialYear
FinancialYearStarting creates new financial year by starting year.
func (FinancialYear) Start ¶
func (fy FinancialYear) Start() time.Time
Start start date of financial year.
func (FinancialYear) String ¶
func (fy FinancialYear) String() string