Skip to content

anatoliyfedorenko/isdayoff

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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