当前位置:网站首页>【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次免费机会
边栏推荐
- Abnova anti GBA monoclonal antibody solution
- Wechat circle of friends test point
- On the difference between strlen and sizeof
- 论文阅读 Exploring Temporal Information for Dynamic Network Embedding
- Exploring temporary information for dynamic network embedding
- PTA class a simulated ninth bullet: 1114-1117
- Disruptor(一)Sequence
- CS144 环境配置
- Sweet girl lisixia was invited to be the little host of the global finals of the sixth season perfect child model
- 静态库动态库的使用
猜你喜欢
随机推荐
Redis-链表
连接投影仪
如何制定一个可实现的年度目标?
CS144 环境配置
How to add a "security lock" to the mobile office of government and enterprises?
Introduction to gun make (1)
Tengwenze, a hot-blooded boy, was invited to serve as the image ambassador of the global finals of the sixth season perfect children's model
How to set an achievable annual goal?
Sweet girl lisixia was invited to be the little host of the global finals of the sixth season perfect child model
Detailed explanation of memory leak check tools
Difference between app test and web test
One stop solution EMQ for hundreds of millions of communication of Internet of things
Sweet cool girl jinshuyi was invited to be the spokesperson for the global finals of the sixth season perfect children's model
初识Opengl
pixel 6 root
Multi type study of Worthington collagen protease
The answer skills and examples of practical cases of the second construction company are full of essence
求n的乘阶
It's better to finish one than start thousands of times (reprinted from Douban)
Pre ++, post ++ and pre -- and post -- (+a, a++ and --a, a--)