nz

package
v2.1.35 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: BSD-3-Clause Imports: 3 Imported by: 2 modules, 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.

Documentation

Overview

Package nz provides holiday definitions for New Zealand.

Index

Constants

This section is empty.

Variables

View Source
var (

	// NewYear represents New Year's Day on 1-Jan
	NewYear = aa.NewYear.Clone(&cal.Holiday{Name: "New Year's Day", Type: cal.ObservancePublic, Observed: weekendAlt})

	// DayAfterNewYear represents Day after New Year's Day on 2-Jan
	DayAfterNewYear = &cal.Holiday{
		Name:  "Day after New Year's Day",
		Type:  cal.ObservancePublic,
		Month: time.January,
		Day:   2,
		Observed: []cal.AltDay{
			{Day: time.Saturday, Offset: 2},
			{Day: time.Sunday, Offset: 2},
			{Day: time.Monday, Offset: 1}},
		Func: cal.CalcDayOfMonth,
	}

	// WaitangiDay represents Waitangi Day on 6-Feb
	WaitangiDay = &cal.Holiday{
		Name:     "Waitangi Day",
		Type:     cal.ObservancePublic,
		Month:    time.February,
		Day:      6,
		Observed: weekendAlt,
		Func:     cal.CalcDayOfMonth,
	}

	// GoodFriday represents Good Friday - two days before Easter
	GoodFriday = aa.GoodFriday.Clone(&cal.Holiday{Name: "Good Friday", Type: cal.ObservancePublic})

	// EasterMonday represents Easter Monday - the day after Easter
	EasterMonday = aa.EasterMonday.Clone(&cal.Holiday{Name: "Easter Monday", Type: cal.ObservancePublic})

	// AnzacDay represents ANZAC Day on 25-Apr
	AnzacDay = &cal.Holiday{
		Name:     "ANZAC Day",
		Type:     cal.ObservancePublic,
		Month:    time.April,
		Day:      25,
		Observed: weekendAlt,
		Func:     cal.CalcDayOfMonth,
	}

	// KingsBirthday represents King's Birthday on the first Monday in June
	KingsBirthday = &cal.Holiday{
		Name:    "Queen's Birthday",
		Type:    cal.ObservancePublic,
		Month:   time.June,
		Weekday: time.Monday,
		Offset:  1,
		Func:    cal.CalcWeekdayOffset,
	}

	// QueensBirthday was the name of King's Birthday holiday during the reign of Queen Elizabeth II
	QueensBirthday = KingsBirthday

	// Matariki represents the Matariki public holiday, on the Friday closest to the Māori New Year
	Matariki = &cal.Holiday{
		Name: "Matariki",
		Type: cal.ObservancePublic,
		Func: CalcMatarikiOffset,
	}

	// LabourDay represents Labour Day on the fourth Monday in October
	LabourDay = &cal.Holiday{
		Name:    "Labour Day",
		Type:    cal.ObservancePublic,
		Month:   time.October,
		Weekday: time.Monday,
		Offset:  4,
		Func:    cal.CalcWeekdayOffset,
	}

	// ChristmasDay represents Christmas Day on 25-Dec
	ChristmasDay = aa.ChristmasDay.Clone(&cal.Holiday{Name: "Christmas Day", Type: cal.ObservanceBank, Observed: weekendAlt})

	// BoxingDay represents Boxing Day on 26-Dec
	BoxingDay = aa.ChristmasDay2.Clone(&cal.Holiday{Name: "Boxing Day", Type: cal.ObservanceBank,
		Observed: []cal.AltDay{
			{Day: time.Saturday, Offset: 2},
			{Day: time.Sunday, Offset: 2},
			{Day: time.Monday, Offset: 1}}})

	// Holidays provides a list of the standard national holidays
	Holidays = []*cal.Holiday{
		NewYear,
		DayAfterNewYear,
		WaitangiDay,
		GoodFriday,
		EasterMonday,
		AnzacDay,
		QueensBirthday,
		LabourDay,
		ChristmasDay,
		BoxingDay,
	}
)
View Source
var DefaultLoc = time.Local

Functions

func CalcMatarikiOffset added in v2.1.28

func CalcMatarikiOffset(h *cal.Holiday, year int) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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