us

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: 21 modules, 19 packages

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 us provides holiday definitions for the United States of America.

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})

	// MlkDay represents Martin Luther King Jr. Day on the 3rd Monday in January
	MlkDay = &cal.Holiday{
		Name:    "Martin Luther King Jr. Day",
		Type:    cal.ObservancePublic,
		Month:   time.January,
		Weekday: time.Monday,
		Offset:  3,
		Func:    cal.CalcWeekdayOffset,
	}

	// PresidentsDay represents Presidents' Day on the 3rd Monday in February
	PresidentsDay = &cal.Holiday{
		Name:    "Presidents' Day",
		Type:    cal.ObservancePublic,
		Month:   time.February,
		Weekday: time.Monday,
		Offset:  3,
		Func:    cal.CalcWeekdayOffset,
	}

	// MemorialDay represents Memorial Day on the last Monday in May
	MemorialDay = &cal.Holiday{
		Name:    "Memorial Day",
		Type:    cal.ObservancePublic,
		Month:   time.May,
		Weekday: time.Monday,
		Offset:  -1,
		Func:    cal.CalcWeekdayOffset,
	}

	// Juneteenth represents Juneteenth on June 19th
	Juneteenth = &cal.Holiday{
		Name:      "Juneteenth",
		Type:      cal.ObservancePublic,
		Month:     time.June,
		Day:       19,
		Observed:  weekendAlt,
		Func:      cal.CalcDayOfMonth,
		StartYear: 2021,
	}

	// IndependenceDay represents Independence Day on 4-Jul
	IndependenceDay = &cal.Holiday{
		Name:     "Independence Day",
		Type:     cal.ObservancePublic,
		Month:    time.July,
		Day:      4,
		Observed: weekendAlt,
		Func:     cal.CalcDayOfMonth,
	}

	// LaborDay represents Labor Day on the first Monday in September
	LaborDay = &cal.Holiday{
		Name:    "Labor Day",
		Type:    cal.ObservancePublic,
		Month:   time.September,
		Weekday: time.Monday,
		Offset:  1,
		Func:    cal.CalcWeekdayOffset,
	}

	// ColumbusDay represents Columbus Day on the second Monday in October
	ColumbusDay = &cal.Holiday{
		Name:    "Columbus Day",
		Type:    cal.ObservancePublic,
		Month:   time.October,
		Weekday: time.Monday,
		Offset:  2,
		Func:    cal.CalcWeekdayOffset,
	}

	// VeteransDay represents Veterans Day on 11-Nov
	VeteransDay = &cal.Holiday{
		Name:     "Veterans Day",
		Type:     cal.ObservancePublic,
		Month:    time.November,
		Day:      11,
		Observed: weekendAlt,
		Func:     cal.CalcDayOfMonth,
	}

	// ThanksgivingDay represents Thanksgiving Day on the fourth Thursday in November
	ThanksgivingDay = &cal.Holiday{
		Name:    "Thanksgiving Day",
		Type:    cal.ObservancePublic,
		Month:   time.November,
		Weekday: time.Thursday,
		Offset:  4,
		Func:    cal.CalcWeekdayOffset,
	}

	// DayAfterThanksgivingDay represents the day after Thanksgiving Day on the fourth Friday in November
	DayAfterThanksgivingDay = &cal.Holiday{
		Name:       "Day After Thanksgiving Day",
		Type:       cal.ObservancePublic,
		Month:      time.November,
		Weekday:    time.Thursday,
		Offset:     4,
		CalcOffset: 1,
		Func:       cal.CalcWeekdayOffset,
	}

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

	// Holidays provides a list of the standard national holidays
	Holidays = []*cal.Holiday{
		NewYear,
		MlkDay,
		PresidentsDay,
		MemorialDay,
		Juneteenth,
		IndependenceDay,
		LaborDay,
		ColumbusDay,
		VeteransDay,
		ThanksgivingDay,
		ChristmasDay,
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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