-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconSecDays.js
More file actions
45 lines (41 loc) · 1.28 KB
/
Copy pathconSecDays.js
File metadata and controls
45 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const leapYear=(num)=>{
if (num % 400 === 0){
return true
} else if (num % 100 === 0){
return false
} else if (num % 4 === 0){
return true
} else {
return false
}
}
const consecDays = (CDayNum,LDCCombo,year) => {
if (leapYear(year) === true && LDCCombo === 229 && CDayNum === 1 ){
// ++user.consecutiveDays
console.log("leap year Consec")
} else if (leapYear(year) === true && LDCCombo === 229 && CDayNum === 1 ){
// ++user.consecutiveDays
console.log("feb Consec")
}
else if (CDayNum === 1 && (LDCCombo === 131 ||
LDCCombo === 331 || LDCCombo === 531
|| LDCCombo === 731
|| LDCCombo === 831
|| LDCCombo === 1031
|| LDCCombo === 1231
|| LDCCombo === 430
|| LDCCombo === 630
|| LDCCombo === 930
|| LDCCombo === 1130)){
console.log('its and end of month consec')
// ++user.consecutiveDays
} else if (CDayNum == (LDCCombo + 1)){
console.log("standard consecuful")
// ++user.consecutiveDays
} else {
console.log("those Aint Consecutive at ALL")
}
}
// console.log(leapYear(2014))
// console.log(2019 % 4)
console.log(consecDays(10,8,2020))