calendar

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package calendar generates and has utlilty functions to generate an HTML calendar for use in nlgids.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date(t time.Time) string

Types

type AvailMeta

type AvailMeta struct {
	Available
	Meta
}

The availabilty for a specific date.

type Available

type Available int
const (
	Past Available
	Busy
	Free
)

func (Available) String

func (a Available) String() string

type Calendar

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

Calendar holds the HTML that makes up the calendar. Each day is indexed by the 12 o' clock night time as a time.Time. All date are in the UTC timezone.

func New

func New(d, subject, secret string) (*Calendar, error)

New creates a new month calendar based on d, d must be in the form: YYYY-MM-DD. D can also be the empty string, then the current date is assumed.

func (*Calendar) Days

func (c *Calendar) Days() map[time.Time]AvailMeta

Days returns the days of this calendar.

func (*Calendar) Footer

func (c *Calendar) Footer() string

func (*Calendar) FreeBusy

func (c *Calendar) FreeBusy() error

FreeBusy will retrieve all evens for this Calendar and mark each day as either free or busy depending on the All-Day events in the Google Calendar. TODO(miek): This works only for 1-day freebusy events, not for multiday events!

func (*Calendar) HTML

func (c *Calendar) HTML() string

HTML returns the calendar in a string containing HTML.

func (*Calendar) Header

func (c *Calendar) Header() (string, error)

Header returns the header of the calendar.

type Meta

type Meta int
const (
	Now Meta
	Prev
	Next
)

func (Meta) String

func (m Meta) String() string

Jump to

Keyboard shortcuts

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