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

github.com/xiaoxuan6/chinese-holidays-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/xiaoxuan6/chinese-holidays-api

  • v0.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

chinese-holidays-api

提供中国休假或者工作日查询

Run

直接运行

go run main.go

自定义端口

export HOLIDAY_PORT=9002
go run main.go

Docker

直接运行

docker run --name=holidays -p 80:80 -d ghcr.io/xiaoxuan6/chinese-holidays-api/chinese-holidays-api:latest

自定义端口

docker run --name=holiday -e HOLIDAY_PORT=9002 -p 9002:9002 -d ghcr.io/xiaoxuan6/chinese-holidays-api/chinese-holidays-api:latest

Api

查询 2024-08-06 是否是工作日

curl http://127.0.0.1/api/holidays/2024-08-06
or
curl http://127.0.0.1/api/holidays?date=2024-08-06

{
  "code": 200,
  "date": "2024-08-06", <- version v0.0.2
  "is_holiday": false,
  "is_working_day": true,
  "lunar_date": "七月初二日", <- version v0.0.3
  "lunar_year": "甲辰年", <- version v0.0.4
  "msg": "query ok",
  "weekday": "星期一", <- version v0.0.2
  "zh_year": "龙年" <- version v0.0.4
}

返回参数:

字段描述
code返回状态值(200:表示成功,500:表示失败)
msg描述
date查询日期
lunar_date农历日期
lunar_year农历年份
is_holiday是否是节假日
is_working_day是否是工作日
weekday星期几
zh_year生肖年份

Features

  • bundled data
    • support 2024
    • support 2023
    • support 2022
    • support 2021
    • support 2020
    • support 2019 and 5.1 changes
    • support 2018
    • support 2017
    • support 2016

FAQs

Package last updated on 22 Oct 2024

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