当前位置:网站首页>[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
边栏推荐
猜你喜欢

关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法

cv==biaoding---open----cv001

Visual studio 2013 redistributable is installed, but MySQL installation fails

SDRAM控制器——添加读写FIFO

vscode调试时提示更新到最新调试版本

Abnova actn4 DNA probe solution

工作一年闲记

@Query 疑难杂症

Show spirit chenzitong was invited to be the chief experience officer of the global finals of the sixth season perfect children's model

Jenkins localization and its invalid solution
随机推荐
wifi 的理论速度计算方法
Gun make (3) Rules for makefile
jenkins汉化及汉化无效解决方案
Abnova actn4 DNA probe solution
LeetCode 31 ~ 40
Exploring temporary information for dynamic network embedding
readv & writev
Ndk20b ffmpeg4.2.2 compilation and integration
Detailed explanation of memory leak check tools
Other codes,, VT,,, K
One minute to understand the difference between synchronous, asynchronous, blocking and non blocking
The role of xargs
memory leak check tools 详解
Shell learning record (IV)
A lost note for konjaku beginner
UN make (6) conditional execution of makefile
Connecting the projector
SDRAM控制器——仲裁模块的实现
Characteristics and related specificity of Papain
接口测试用例设计