jpholiday

package module
v0.0.0-...-e40e9e1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

Go Test Update Holidays

jpholiday

このパッケージは、日本の祝日に関する機能を提供します。

インストール

go get github.com/garupanojisan/jpholiday

制限

このパッケージは、1955年から2025年までの祝日に対応しています。

使い方

package main

import (
	"fmt"
	"time"
	
	"github.com/GarupanOjisan/jpholiday"
)

func main() {
	// 2023年1月1日は祝日かどうか
	jst, _ := time.LoadLocation("Asia/Tokyo")
	date := time.Date(2023, 1, 1, 0, 0, 0, 0, jst)
	isHoliday := jpholiday.IsJapanHoliday(date)
	fmt.Println("2023年1月1日は祝日ですか?", isHoliday)

	// 2023年1月1日の祝日名
	name, ok := jpholiday.GetJapanHolidayName(date)
	if ok {
		fmt.Println("2023年1月1日の祝日名は", name, "です")
	} else {
		fmt.Println("2023年1月1日は祝日ではありません")
	}
}

参考情報

このパッケージの祝日情報は、内閣府のウェブサイトに掲載されている祝日のリストを元にしています。

https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJapanHolidayName

func GetJapanHolidayName(date time.Time) (name string, ok bool)

GetJapanHolidayName returns the name of the holiday in Japan.

func IsJapanHoliday

func IsJapanHoliday(date time.Time) bool

IsJapanHoliday returns true if the date is a holiday in Japan.

Types

This section is empty.

Directories

Path Synopsis
hack

Jump to

Keyboard shortcuts

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