当前位置:网站首页>【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
- cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
- cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
- It's better to finish one than start thousands of times (reprinted from Douban)
- Gun make (5) variables in makefile
- socket demo01
- Brief introduction to the usage of iloc in dataframe
- PTA class a simulated seventh bomb: 1160-1163
- 17.11 std:: atomic continuation, std:: async in-depth discussion
猜你喜欢

readv & writev

Redis7.0的安装步骤

recv & send

元气少女王钰洁 受邀担任第六季完美童模全球总决赛代言人

V4L2+QT视频优化策略

About vs scanf, 'scanf' appears: this function or variable may be unsafe Solutions to the problem of consumer usi

Abnova actn4 DNA probe solution

Abnova CSV monoclonal antibody solution

Xiaomi tablet 5 Pro unlock bootloader

One stop solution EMQ for hundreds of millions of communication of Internet of things
随机推荐
Abnova CMV CISH probe solution
高手常用的电脑快捷键
物联网亿万级通信一站式解决方案EMQ
PTA class a simulated second bullet: 1136-1139
One stop solution EMQ for hundreds of millions of communication of Internet of things
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
App test (I)
Gun make (5) variables in makefile
Redis的使用
一分钟了解同步、异步、阻塞和非阻塞的区别
Characteristics and related specificity of Papain
Tcp网络通信中各个状态的含义
cv==biaoding---open----cv001
-- EGFR FISH probe solution
王老吉药业“关爱烈日下最可爱的人”公益活动在杭启动
关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
Dazhou suggested that we media bloggers do these four things in the early stage
Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) D. Felicity‘s Big Secret Revealed
wifi 的理论速度计算方法
Detailed explanation of WiFi related knowledge