Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/hexuejian/holidays

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/hexuejian/holidays

  • v0.0.0-20210507051842-e3e8ca87fc05
  • Source
  • Go
  • Socket score

Version published
Created
Source

节假日库

项目中需要用到节假日查询接口:1. 网络上免费的不稳定 2. 稳定的需要收费,而且带很多不需要的信息

基于此,开发一款极度精简的节假日库

API List

FetchAll

获取当前公布的从 2010 ~ 2019 的官方节假日安排

FetchByYear(year int)

获取当前公布的节假日安排,按年份查询

FetchByMonth(year int, month int)

获取当前公布的节假日安排,按年份和月份查询

FetchByChName(year int, name string)

获取当前公布的节假日安排,按年份和中文名称查询

FetchByEnName(year int, name string)

获取当前节假日安排,按年份和英文名称查询

FetchYearHolidayCount(year int)

获取某年存在多少天的假期

IsHoliday(date string)

判断某天是否是节假日,某天的格式是:"2006/01/02"

IsWorkDay(date string)

判断某天是否是工作日,某天的格式是: "2006/01/02"

IsWeekDay(date string)

判断某天是否是周末,某天的格式是: "2006/01/02"


<使用愉快...>

英文文档

英文文档

TODO

  • 追踪具体信息来源:自动监控、自动抓取、自动解析

FAQs

Package last updated on 07 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc