holidays

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

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

Go to latest
Published: May 18, 2017 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIsBusinessDay

func CheckIsBusinessDay(hDate time.Time, hols Holidays) bool

CheckIsBusinessDay determines whether a given date is either at the weekend or a public holiday.

func GetFirstBusinessDay

func GetFirstBusinessDay(hDate time.Time, hols Holidays) time.Time

GetFirstBusinessDay returns either the current date or, if that is not a working day, the next day that is.

Types

type Holiday

type Holiday struct {
	time.Time
	Name         string // Common name for this holiday
	NotStatutory bool   // Not a legally binding holiday. May not be a free day for all employees.
	HalfDay      bool   // This is a half-day holiday.
}

Holiday defines an individual public holiday.

type Holidays

type Holidays struct {
	// You can find ISO3166-2 codes on Wikipedia, for e.g. Austria:
	// https://en.wikipedia.org/wiki/ISO_3166-2:AT
	Country  string    // ISO3166-1 country code
	Name     string    // name of subdivision
	Timezone string    // Timezone used in this area
	Workdays []string  // An array listing the normal workdays
	Holidays []Holiday // A set of public holidays
}

Holidays defines a set of public holidays for a given territory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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