func (c *BusinessCalendar) WorkdaysInMonth(year int, month time.Month) int {
	t := time.Date(year, month, 1, 12, 0, 0, 0, time.UTC)
	if c.IsWorkday(t) {
		return c.WorkdaysRemain(t) + 1
	}
	return c.WorkdaysRemain(t)
}
WorkdaysInMonth reports the total number of workdays for the given year and
month.
package cal
import "time"
type WorkdayFn func(date time.Time) bool
type WorkdayStartFn func(date time.Time) time.Time
type WorkdayEndFn func(date time.Time) time.Time
type BusinessCalendar struct {
	workday     [7]bool    
	WorkdayFunc WorkdayFn  
	workdayStart     time.Duration   
	WorkdayStartFunc WorkdayStartFn  
	workdayEnd       time.Duration   
	WorkdayEndFunc   WorkdayEndFn    
	Calendar
}
func NewBusinessCalendar() *BusinessCalendar {
	c := &BusinessCalendar{}
	c.workday[time.Monday] = true
	c.workday[time.Tuesday] = true
	c.workday[time.Wednesday] = true
	c.workday[time.Thursday] = true
	c.workday[time.Friday] = true
	c.workdayStart = 9 * time.Hour
	c.workdayEnd = 17 * time.Hour
	return c
}
func (c *BusinessCalendar) SetWorkday(day time.Weekday, workday bool) {
	c.workday[day] = workday
}
func (c *BusinessCalendar) SetWorkHours(start time.Duration, end time.Duration) {
	c.workdayStart = start
	c.workdayEnd = end
}
func (c *BusinessCalendar) IsWorkday(date time.Time) bool {
	var workday bool
	if c.WorkdayFunc == nil {
		workday = c.workday[date.Weekday()]
	} else {
		workday = c.WorkdayFunc(date)
	}
	if !workday {
		return false
	}
	_, obs, _ := c.IsHoliday(date)
	if obs {
		return false
	}
	return true
}
func (c *BusinessCalendar) IsWorkTime(date time.Time) bool {
	if !c.IsWorkday(date) {
		return false
	}
	var startHour int
	var startMinute int
	var endHour int
	var endMinute int
	if c.WorkdayStartFunc == nil {
		startHour = int(c.workdayStart.Hours()) % 24
		startMinute = int(c.workdayStart.Minutes()) % 60
	} else {
		startTime := c.WorkdayStartFunc(date)
		startHour = startTime.Hour()
		startMinute = startTime.Minute()
	}
	if c.WorkdayEndFunc == nil {
		endHour = int(c.workdayEnd.Hours()) % 24
		endMinute = int(c.workdayEnd.Minutes()) % 60
	} else {
		endTime := c.WorkdayEndFunc(date)
		endHour = endTime.Hour()
		endMinute = endTime.Minute()
	}
	h := date.Hour()
	m := date.Minute()
	return (h == startHour && m >= startMinute) ||
		(h > startHour && h < endHour) ||
		(h == endHour && m <= endMinute)
}
func (c *BusinessCalendar) WorkdaysRemain(date time.Time) int {
	n := 0
	month := date.Month()
	date = date.AddDate(0, 0, 1)
	for ; month == date.Month(); date = date.AddDate(0, 0, 1) {
		if c.IsWorkday(date) {
			n++
		}
	}
	return n
}