当前位置:网站首页>[free and easy to use] holiday query interface
[free and easy to use] holiday query interface
2022-07-26 05:53:00 【A rookie is a great God】
summary
Usually in the process of development, we often use the function of querying holidays , But because holidays are announced by the State Council every year , We
Can't compute holidays , So we usually need to maintain holidays manually .
There are many holiday query interfaces on the Internet , But the query conditions and returned results are not ideal ,
So I wrote a holiday query interface and provided a simple page . The interface provides rich query parameters, and the response fields can be customized freely .
Quick start
Holiday inquiry Address of the interface by :
https://api.apihubs.cn/holiday/get
Direct access to the interface address will get the whole month data of the current year and month , It contains detailed holiday information
Holiday inquiry Sample page address by :
http://www.apihubs.cn/#/holiday
In the example page, the interface address will be generated dynamically according to the conditions you choose , Then you can directly click the browser to open the interface address and preview the interface return information
Parameters
Holiday query interface provides rich query parameters , All parameters are optional , It can be used flexibly , Between the conditions is && The relationship between
The date format in the parameter is PHP Medium Date format
field Used to specify the fields contained in the returned results , Multiple are separated by commas enumeration
year Used to specify the year to query , The format is Y , Multiple are separated by commas
month Used to specify the month to query , The format is Ym , Multiple are separated by commas
date Used to specify the date to query , The format is Ymd , Multiple are separated by commas
yearweek Used to specify the week of the year to query , The format is oW , Multiple are separated by commas
yearday Used to specify the day of the year to query , The format is z , Multiple are separated by commas
holiday Used to specify holidays to query ,99 For all holidays , Multiple are separated by commas enumeration
holiday_overtime It is used to specify holidays to query ( Work overtime ),99 Take a rest for all , Multiple are separated by commas enumeration
week Used to specify the week to query , Multiple are separated by commas enumeration
workday Used to specify whether the query is a weekday ( Days to go to work, including days off ) enumeration
weekend Used to specify whether the query is weekend ( Saturday and Sunday ) enumeration
holiday_today Used to specify whether the query is festival day enumeration
holiday_legal Used to specify whether the query is a legal holiday ( Three times wages ) enumeration
holiday_recess Used to specify whether the query is a holiday ( Is the festival a holiday ) enumeration
lunar Used to specify the year 、 month 、 date 、 Whether the days parameter queries the lunar date
cn Used to specify whether the returned result contains Chinese results , The default values are numbers, dates and enumerations, which are good for logical judgment and bad for display
page Page numbers
size Number of pages per page
Respond to
The enumeration function of the holiday query interface is based on php-enum Implementation of unified format response
Holiday query interface response is always JSON data format , as follows
{
"code": 0,
"msg": "ok",
"data": ""
}
code Success is always 0, On failure: Enumerated values Medium key
msg Success is always ok On failure: Enumerated values Medium value
data Returns data on success , Some of the failure data will be returned in case of failure , If the form fails to verify .
data.page The current page number
data.size Current number per page
data.total The total quantity found according to the query conditions
data.list Holiday list
data.list Contains holiday details , All of the fields can be accessed through field Parameters are used on demand
By default, numeric date and enumeration code will be returned , It's perfect for making logical judgments . as follows
{
"year": 2021,
"month": 202101,
"date": 20210101,
"yearweek": 202053,
"yearday": 1,
"lunar_year": 2020,
"lunar_month": 202011,
"lunar_date": 20201118,
"lunar_yearday": 343,
"week": 5,
"weekend": 2,
"workday": 2,
"holiday": 22,
"holiday_or": 22,
"holiday_overtime": 10,
"holiday_today": 1,
"holiday_legal": 1,
"holiday_recess": 1
}
When open the cn Query parameters , Will add _cn Suffixes return the new visualization , And return with the original field . as follows
{
"year": 2021,
"month": 202101,
"date": 20210101,
"yearweek": 202053,
"yearday": 1,
"lunar_year": 2020,
"lunar_month": 202011,
"lunar_date": 20201118,
"lunar_yearday": 343,
"week": 5,
"weekend": 2,
"workday": 2,
"holiday": 22,
"holiday_or": 22,
"holiday_overtime": 10,
"holiday_today": 1,
"holiday_legal": 1,
"holiday_recess": 1,
"year_cn": "2021 year ",
"month_cn": "2021 year 01 month ",
"date_cn": "2021 year 01 month 01 Japan ",
"yearweek_cn": "2020 In the first 53 Zhou ",
"yearday_cn": "2021 In the first 1 God ",
"lunar_year_cn": " In 2020 ",
"lunar_month_cn": " In the winter of 2020 ",
"lunar_date_cn": " On the 18th of winter, 2020 ",
"lunar_yearday_cn": "2020 In the first 343 God ",
"week_cn": " Friday ",
"weekend_cn": " Non weekend ",
"workday_cn": " Non working days ",
"holiday_cn": " New year's Day ",
"holiday_or_cn": " New year's Day ",
"holiday_overtime_cn": " Not on holidays ",
"holiday_today_cn": " On the day of the festival ",
"holiday_legal_cn": " Statutory holidays ",
"holiday_recess_cn": " Holidays, holidays "
}
year Gregorian calendar year
month The month of the Gregorian calendar
date Gregorian date
yearweek The week of the year in the Gregorian calendar , Notice that the year here is ISO-8601 Week number year , Always take Monday to Sunday as a week . If you need to get 7 Days are days of a week divided by days in a year 7 that will do .
yearday The day of the year in the Gregorian calendar
lunar_year Lunar year
lunar_month Lunar month
lunar_date Lunar date
lunar_yearday What day of the year in the lunar calendar
week What day
weekend Whether it's a weekend
workday Is it a working day ( Days to go to work, including days off )
holiday The holiday season , Two digit enumeration is used here to indicate holidays , The special number 10 It's not a holiday , Special numbers 99 It means all holidays
holiday_or Other holidays , Enumeration is the same as holidays , It means another festival on the same day , Such as 2020-10-01
holiday_overtime Holidays , Enumeration is the same as holidays
holiday_today Whether it's festival day
holiday_legal Is it a legal holiday ( Three times wages )
holiday_recess Whether it's a holiday or not ( Is the festival a holiday )
边栏推荐
- Kingbasees SQL language reference manual of Jincang database (10. Query and sub query)
- Binary sort tree (BST)~
- Lightweight MCU command line interaction project, all open source
- 轻量级单片机命令行交互项目,全部开源
- leetcode-aboutString
- 知识沉淀一:架构师是做什么?解决了什么问题
- 漫谈软件缺陷管理的实践
- How can programmers improve mental internal friction?
- Unity Profiler
- ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’
猜你喜欢

Redis主从复制

语法泛化三种可行方案介绍
![[STM32 series summary] blogger's way to quickly advance STM32 in actual combat (continuous update)](/img/20/bf7d2653aafd35e6588f819d110453.png)
[STM32 series summary] blogger's way to quickly advance STM32 in actual combat (continuous update)

Dynamic memory management and flexible array
![ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’](/img/15/25ff1e544565e18319ecca85e614a2.png)
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’

SSH Remote Management

为什么LPDDR不能完全代替DDR?

A trick to teach you to easily understand Potter's map
![[paper notes] anti packet loss joint coding for network speech steganography](/img/ca/95476b6d4b5765f5fde82cbeda577e.png)
[paper notes] anti packet loss joint coding for network speech steganography

ES Cluster in Red status: what about write & delete operations?
随机推荐
为什么LPDDR不能完全代替DDR?
MBA-day28 数的概念-练习题
金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(十一))
Project topic selection reference
NFT in the eyes of blackash: the platform is crying for slaughter, and users send money to the door
Kingbasees SQL language reference manual of Jincang database (8. Function (10))
Redis transaction
Mysql45 speak in simple terms index
leetcode-aboutString
【(SV && UVM) 笔试面试遇到的知识点】~ phase机制
金仓数据库 KingbaseES SQL 语言参考手册 (5. 操作符)
Solution to slow download speed of vagrant
金仓数据库 KingbaseES SQL 语言参考手册 (10. 查询和子查询)
Properties of binary tree~
Use latex to typeset multiple-choice test paper
光量子里程碑:6分钟内解决3854个变量问题
No EGL display error resolution
Interview questions for software testing is a collection of interview questions for senior test engineers, which is exclusive to the whole network
Using easyexcel to import tables to realize batch insertion of xlsx files ----- MySQL of Linux
金仓数据库 KingbaseES SQL 语言参考手册 (6. 表达式)