当前位置:网站首页>【js】免费api判断节假日、工作日和周六日
【js】免费api判断节假日、工作日和周六日
2022-06-26 00:27:00 【栀妹儿】
前端无法单纯判断节假日、工作日和周六日
后端接口需要利用网上接口资源:
大神接口来源:提莫的神秘商店
1、接口地址:http://timor.tech/api/holiday/info/你请求的日期YYYY-MM-DD
2、我的代码里这样写:
// script:
import axios from 'axios'
// methods:
let time = '2022-06-25'
axios.get('http://timor.tech/api/holiday/info/'+time).then(res => {
console.log('返回数据:',res);
});
3、返回数据:
打印结果:
请求示例:http://timor.tech/api/holiday/info/2022-6-25
接口返回:{“code”:0,“type”:{“type”:1,“name”:“周六”,“week”:6},“holiday”:null}
4、其他使用教程:
{
"code": 0, // 0服务正常。-1服务出错
"type": {
"type": enum(0, 1, 2, 3), // 节假日类型,分别表示 工作日、周末、节日、调休。
"name": "周六", // 节假日类型中文名,可能值为 周一 至 周日、假期的名字、某某调休。
"week": enum(1 - 7) // 一周中的第几天。值为 1 - 7,分别表示 周一 至 周日。
},
"holiday": {
//工作日时为null
"holiday": false, // true表示是节假日,false表示是调休
"name": "国庆前调休", // 节假日的中文名。如果是调休,则是调休的中文名,例如'国庆前调休'
"wage": 1, // 薪资倍数,1表示是1倍工资
"after": false, // 只在调休下有该字段。true表示放完假后调休,false表示先调休再放假
"target": '国庆节' // 只在调休下有该字段。表示调休的节假日
}
}

其他参考
1、郑川 / 日期分析节假日分析工作日分析判断日期是不是假期判断日期是不是工作日但我一直显示接口获取不到orz
2、聚合数据万年历
需要注册-申请api-获取key-使用普通用户每天只有10次免费机会
边栏推荐
猜你喜欢

Make a row of the dataframe a column name

jenkins汉化及汉化无效解决方案

pixel 6 root

One stop solution EMQ for hundreds of millions of communication of Internet of things

Redis7.0 installation steps

Sweet girl lisixia was invited to be the little host of the global finals of the sixth season perfect child model

一分钟了解同步、异步、阻塞和非阻塞的区别

biggan:large scale gan training for high fidelity natural image synthesis

二造实务案例答题技巧和举例汇总,满满都是精髓

Energetic girl wangyujie was invited to be the spokesperson for the global finals of the sixth season perfect children's model
随机推荐
Steps of program compilation precompile compilation assembly connection
Dataframe extracts data from a column and converts it into a list
A lost note for konjaku beginner
Perfdog
shell学习记录(三)
Eight principles of element positioning
静态库动态库的使用
The role of xargs
biggan:large scale gan training for high fidelity natural image synthesis
How to add a "security lock" to the mobile office of government and enterprises?
The 19th - 22nd week of scientific research training - about tnet and memnet
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
LeetCode 31 ~ 40
vscode调试时提示更新到最新调试版本
秀场精灵陈梓桐 受邀担任第六季完美童模全球总决赛首席体验官
Disruptor(一)Sequence
pixel 6 root
Gun make (5) variables in makefile
regular expression
Detailed explanation of memory leak check tools