Documentation
¶
Overview ¶
Package bitcal provides functions for doing date math with business calendars. It uses bit vectors to track working days from non-working days.
Index ¶
- Variables
- type BitCal
- func (c *BitCal) AddWorkDays(date time.Time, days int, include bool) (ret_date time.Time)
- func (c *BitCal) DeltaWorkDays(date1 time.Time, date2 time.Time) (days int)
- func (c *BitCal) IsWorkDay(date time.Time) (ret bool)
- func (c *BitCal) WorkDayNextIncl(date time.Time) (ret_date time.Time)
- func (c *BitCal) WorkDayPrevIncl(date time.Time) (ret_date time.Time)
- type Holidays
- type Workdays
Constants ¶
This section is empty.
Variables ¶
Predefined Workdays type for the US work week. Mon-Fri are marked true.
Functions ¶
This section is empty.
Types ¶
type BitCal ¶
type BitCal struct {
// contains filtered or unexported fields
}
func Create ¶
Create takes a Workday and Holidays struct and returns an initialized struct in return that can be used for calls against that Calendar.
func (*BitCal) AddWorkDays ¶
AddWorkDays take a starting time.Time and the number of work days( positive or negative ) to add to the date. When include is true, the current date is included and if it is a non work-day it will the not skip the forwards/backwords work-day. A time.Time is returned.
func (*BitCal) DeltaWorkDays ¶
DeltaWorkDays takes two time.Time's and returns the number of work days between them.
func (*BitCal) WorkDayNextIncl ¶
WorkDayNextIncl take a starting time.Time and returns the Next Workday Including the date given. A time.Time is returned.