当前位置:网站首页>[JS] free API to judge holidays, working days, Saturdays and Sundays
[JS] free API to judge holidays, working days, Saturdays and Sundays
2022-06-26 02:06:00 【Sister Gardenia】
The front end cannot simply judge holidays 、 Weekdays and Saturdays
The back-end interface needs to utilize the network interface resources :
Great God interface source : Timo's mystery shop
1、 Address of the interface :http://timor.tech/api/holiday/info/ The date you requested YYYY-MM-DD
2、 My code says this :
// script:
import axios from 'axios'
// methods:
let time = '2022-06-25'
axios.get('http://timor.tech/api/holiday/info/'+time).then(res => {
console.log(' Return the data :',res);
});
3、 Return the data :
Print the results :
Request example :http://timor.tech/api/holiday/info/2022-6-25
Interface to return :{“code”:0,“type”:{“type”:1,“name”:“ Saturday ”,“week”:6},“holiday”:null}
4、 Other use tutorials :
{
"code": 0, // 0 Normal service .-1 Service error
"type": {
"type": enum(0, 1, 2, 3), // Holiday type , respectively Working day 、 Over the weekend 、 festival 、 Compensatory leave .
"name": " Saturday ", // Chinese name of holiday type , It may be worth Monday to Sunday 、 The name of the holiday 、 So and so off .
"week": enum(1 - 7) // The day of the week . The value is 1 - 7, respectively Monday to Sunday .
},
"holiday": {
// Working day hours are null
"holiday": false, // true It's a holiday ,false Said it was a compensatory leave
"name": " Take a day off before the national day ", // Chinese name of holidays . If it's a compensatory leave , Is the Chinese name of compensatory leave , for example ' Take a day off before the national day '
"wage": 1, // Salary multiples ,1 Said is 1 Double salary
"after": false, // This field is only available under compensatory leave .true It means taking a compensatory leave after the holiday ,false It means taking a compensatory leave before taking a holiday
"target": ' National Day ' // This field is only available under compensatory leave . It means the holiday of compensatory leave
}
}
Other reference
1、 Zhengchuan / Date analysis holiday analysis workday analysis judge whether the date is a holiday judge whether the date is a workday But I always show that the interface can't get orz
2、 Aggregate data perpetual calendar
Need to register - apply api- obtain key- Use Ordinary users only have 10 A free chance
边栏推荐
- UN make (6) conditional execution of makefile
- Pre ++, post ++ and pre -- and post -- (+a, a++ and --a, a--)
- 图形渲染管线
- Shell curl execution script, with passed parameters and user-defined parameters
- 初识Opengl
- On the difference between strlen and sizeof
- Connecting the projector
- Redis-链表
- Three factors affecting personal growth
- shell学习记录(二)
猜你喜欢
How to add a "security lock" to the mobile office of government and enterprises?
Abnova anti GBA monoclonal antibody solution
Shell learning record (I)
关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
A lost note for konjaku beginner
About vs scanf, 'scanf' appears: this function or variable may be unsafe Solutions to the problem of consumer usi
jenkins汉化及汉化无效解决方案
shell学习记录(四)
qtvtkvs2015测试代码
通俗易懂C語言關鍵字static
随机推荐
Gun make (7) execute make
如何使用命令将文件夹中的文件名(包括路径)写入到txt文件中
LeetCode 41 ~ 50
One minute to understand the difference between synchronous, asynchronous, blocking and non blocking
A solution to cross domain problems
其他代码,,vt,,,k
Record a weird picture upload problem
Shell learning record (IV)
记录一个诡异的图片上传问题
树莓派 + AWS IoT Greengrass
螺旋矩阵
Byte order problem
Other codes,, VT,,, K
标定。。。
Gun make (5) variables in makefile
The answer skills and examples of practical cases of the second construction company are full of essence
Easy to understand C language keyword static
How to add a "security lock" to the mobile office of government and enterprises?
Mot - clé C facile à comprendre statique
反向输出一个整数