personplan

package module
v0.0.0-...-c524df9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2018 License: MIT Imports: 3 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

personplan

Code for generating work schedules.

General info

License: MIT

Documentation

Index

Constants

View Source
const (
	FIRSTHOUR = 8
	LASTHOUR  = 22
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HourEvent

type HourEvent struct {
	// contains filtered or unexported fields
}

Info about one thing that can happen during an hour

type HourEvents

type HourEvents []HourEvent

Info about everything that happens during an hour, per person

type PersonPlan

type PersonPlan struct {
	// contains filtered or unexported fields
}

func NewPersonPlan

func NewPersonPlan(who string) *PersonPlan

func (*PersonPlan) AddWorkday

func (pp *PersonPlan) AddWorkday(dayoftheweek time.Weekday, fromHour, uptoHour int, location string)

func (*PersonPlan) String

func (pp *PersonPlan) String() string

type Plans

type Plans struct {
	// contains filtered or unexported fields
}

A plan is a collecion of plans for just a few months at a time

func NewPlans

func NewPlans() *Plans

Make new plans, which is a collection of SemesterPlans

func (*Plans) AddSemesterPlan

func (plans *Plans) AddSemesterPlan(sp *SemesterPlan)

Add a SemesterPlan to the collection of plans

func (*Plans) HTMLHourEvents

func (plans *Plans) HTMLHourEvents(date time.Time) string

Get a string that is suitable to put in a table cell

func (*Plans) PrintHourEvents

func (plans *Plans) PrintHourEvents(date time.Time)

TODO: Create a function just like this that returns a list of HourEvent structs

type SemesterPlan

type SemesterPlan struct {
	// contains filtered or unexported fields
}

func NewSemesterPlan

func NewSemesterPlan(year, fromMonth, uptoMonth int) *SemesterPlan

func (*SemesterPlan) AddPersonPlan

func (sp *SemesterPlan) AddPersonPlan(persplan *PersonPlan)

func (*SemesterPlan) ForAllWeekdays

func (sp *SemesterPlan) ForAllWeekdays(fn func(string, time.Weekday, int, string) string) string

func (*SemesterPlan) GetHourEventStructs

func (sp *SemesterPlan) GetHourEventStructs(t time.Time) HourEvents

Given an hour, gets information from all the person plans in the period plan

func (*SemesterPlan) String

func (sp *SemesterPlan) String() string

func (*SemesterPlan) ViewDay

func (sp *SemesterPlan) ViewDay(date time.Time) string

func (*SemesterPlan) ViewHour

func (sp *SemesterPlan) ViewHour(t time.Time) string

type WorkDayAndLocation

type WorkDayAndLocation struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址