当前位置:网站首页>JS judge whether the year is a leap year and the number of days in the month
JS judge whether the year is a leap year and the number of days in the month
2022-06-11 06:27:00 【Э Time walker to me】
Leap years can be 4 Divisible and not divisible by 100 to be divisible by , Or can be 400 to be divisible by .
Demand from echarts Histogram jump and query the value of current month


Simple code
function year(){
if(year%4 == 0 && year%100 != 0 || year%400 == 0){
console.log(' Leap year ');
}else{
console.log(' Ordinary year ');
}
}
Local code
created() {
let shippingCompanyId = this.$route.params.shippingCompanyId
let month = this.$route.params.month
// console.log(' route 1',this.$cloneDeep(this.$route.params))
if(month && month != undefined){
let strYear= this.$route.params.month.substring(0,4)
let submonth = month.substr(month.lastIndexOf("-") + 1,4); // After intercepting the last dot 4 Characters
this.tempSearch.startTime = month + '-01 00:00:00'
// **************************
if(['01','03','05','07','08','10','12'].includes(submonth)){
this.tempSearch.endTime = month + '-31 23:59:59'
}else if(['02'].includes(submonth)){
if(strYear%4==0 && strYear%100!=0 || strYear%400==0){
// Leap year Leap years can be 4 Divisible and not divisible by 100 to be divisible by , Or can be 400 to be divisible by .
this.tempSearch.endTime = month + '-29 23:59:59'
}else{
// Ordinary year
this.tempSearch.endTime = month + '-28 23:59:59'
}
}else{
this.tempSearch.endTime = month + '-30 23:59:59'
}
// **************************
}
if(shippingCompanyId){
this.args.search.shippingCompanyId = shippingCompanyId
this.getList() // To obtain a list of
}else{
this.getList() // To obtain a list of
}
},
边栏推荐
- C语言大战“扫雷”
- FPGA设计中提高工作频率及降低功耗题目合集
- Observer mode (listener mode) + thread pool to realize asynchronous message sending
- FPGA Design -- ping pong operation implementation and Modelsim simulation
- 解决ffmpeg获取AAC音频文件duration不准
- Sentinel annotation support - @sentinelresource usage details
- 不同VLAN间的通信
- instanceof到底是怎样判断引用数据类型的!
- 解决ffmpeg獲取AAC音頻文件duration不准
- Ethical discussion on reptile Technology
猜你喜欢

What are the differences and usages of break and continue?

verilog实现双目摄像头图像数据采集并modelsim仿真,最终matlab进行图像显示

通过R语言且只用基础package来制作一个小游戏

EasyGBS接入的设备视频直播突然全部无法播放是为什么?数据库读写不够
![Chapter 4 of machine learning [series] naive Bayesian model](/img/77/7720afe4e28cd55284bb365a16ba62.jpg)
Chapter 4 of machine learning [series] naive Bayesian model

Differences between FindIndex and indexof

Shandong University machine learning experiment VI k-means

Error reporting injection of SQL injection

Eureka cluster setup

Teach you to write word formula
随机推荐
关于SIoU的原理和代码实现(回顾IoU、GIoU、DIoU、CIoU)
A multi classification model suitable for discrete value classification -- softmax regression
Handwritten promise [01] - Implementation of promise class core logic
Why is it that the live video of the devices connected to easygbs suddenly cannot be played? Insufficient database read / write
FPGA面试题目笔记(二)——同步异步D触发器、静动态时序分析、分频设计、Retiming
解决ffmpeg获取AAC音频文件duration不准
箭头函数的this指向
不同VLAN间的通信
break,continue有什么区别和用法?
不引入第三个变量,交换两个值
[]==![]
Wechat applet (authorized login of TP5)
Error reporting injection of SQL injection
Shandong University machine learning experiment VI k-means
What is sentinel produced by Ali?
Eureka cluster setup
Shandong University machine learning final 2021
347. top k high frequency elements
Sharing of personal common software and browser plug-ins
Error code in ijkplayer