Skip to content

anatoliyfedorenko/isdayoff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Isdayoff

Requests client for Isdayoff API

Requirements

Go 1.13+

Install

Make sure your project is using Go Modules (it will have a go.mod file in its root if it already is):

go mod init

Then, reference isdayoff module in a Go program with import:

import (
    "github.com/anatoliyfedorenko/isdayoff"
)

Run any of the normal go commands (build/install/test). The Go toolchain will resolve and fetch module automatically.

Alternatively, you can also explicitly go get the package:

go get -u github.com/anatoliyfedorenko/isdayoff

Example

package main

import (
	"fmt"
	"github.com/anatoliyfedorenko/isdayoff"
)

func main() {
	dayOff := isdayoff.New()
	countryCode := CountryCodeKazakhstan
	pre := false
	covid := false
	day, err := dayOff.Tomorrow(Params{
		CountryCode: &countryCode,
		Pre:         &pre,
		Covid:       &covid,
	})    

	fmt.Println(day) // 0
}

Note:

  • TZ names should be taken from IANA