holiday

package module
v0.0.0-...-079ddfc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: MIT Imports: 6 Imported by: 0

README

[deprecated] I moved to this place. -> https://github.com/holiday-jp/holiday_jp-go

holiday_jp-go

GoDoc

🎌 Japanese holiday for Go

Requirements

  • go 1.9 or later

Installing

$ go get github.com/ieee0824/holiday_jp-go

Example

import "github.com/ieee0824/holiday_jp-go"

if holiday.IsHoliday(time.Now()) {
    fmt.Println("today is holiday!")
}

API

New(t time.Time) (*Holiday, error)

New create a new Holiday. If t is not holiday, when return nil and error.

IsHoliday(t time.Time) bool

IsHoliday function checks whether the specified date is a holiday.

HolidayName(t time.Time) (string, error)

HolidayName function returns Holiday name string.

Between(t0, t1 time.Time) Holidays

Between acquires the holiday of the designated section.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HolidayName

func HolidayName(t time.Time) (string, error)

HolidayName function returns Holiday name string.

func IsHoliday

func IsHoliday(t time.Time) bool

IsHoliday function checks whether the specified date is a holiday.

Types

type Holiday

type Holiday map[string]string

Holiday holds holiday info.

func New

func New(t time.Time) (*Holiday, error)

New create a new Holiday. If `t` is not holiday, when return nil and error.

func (*Holiday) Date

func (h *Holiday) Date() (*time.Time, error)

Date returns the day of the holiday.

func (*Holiday) Name

func (h *Holiday) Name() string

Name returns name of the holiday. It behaves in the same way as the String function.

func (*Holiday) NameEn

func (h *Holiday) NameEn() string

NameEn returns english name of the holiday.

func (*Holiday) String

func (h *Holiday) String() string

String returns name of the holiday.

func (*Holiday) Week

func (h *Holiday) Week() string

func (*Holiday) WeekEn

func (h *Holiday) WeekEn() string

type Holidays

type Holidays map[string]Holiday

func Between

func Between(t0, t1 time.Time) Holidays

Between acquires the holiday of the designated section.

func (*Holidays) Names

func (h *Holidays) Names() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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