Introduction | holidays-go | Spatie       

 SPATIE  

holidays-go
===========

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Holidays-go](https://spatie.be/docs/holidays-go/v1)  Introduction

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/holidays-go/v1) 

  Introduction    
- [ Introduction ](https://spatie.be/docs/holidays-go/v1/introduction)
- [ Installation and setup ](https://spatie.be/docs/holidays-go/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/holidays-go/v1/usage)
- [ Adding a new country ](https://spatie.be/docs/holidays-go/v1/adding-a-country)
- [ Testing ](https://spatie.be/docs/holidays-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/holidays-go/v1/releasing)
- [ Changelog ](https://spatie.be/docs/holidays-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/holidays-go/v1/support-us)

  Holidays-go 
=============

 Calculate public holidays for a country in Go 

### Useful links

- [Repository](https://github.com/spatie/holidays-go)
- [Discussions](https://github.com/spatie/holidays-go/discussions)

Introduction
------------

This package can calculate public holidays for a country.

```
import "github.com/spatie/holidays-go"

calendar, err := holidays.For("be", 2024)
if err != nil {
    return err
}
items, err := calendar.Get()
if err != nil {
    return err
}

fmt.Println(items[0].Name) // Nieuwjaar
fmt.Println(items[0].Date) // 2024-01-01
fmt.Println(items[0].Type) // national
```

The Go port includes all 105 codes in the PHP registry, nine regional calendars, the PHP translations, typed holidays and date-range queries. Chinese and Korean lunar calculations use embedded ICU-derived data. PHP and ICU are not required at runtime.

You can replace or extend a country by implementing a `Provider`. Built-in calendars are safe for concurrent reads and keep configuration local to each value.

Start with [installation and setup](installation-and-setup), then read [usage](usage).

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
