mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
chore: split conditionals
Split block of conditionals in separate lines to improve readability
This commit is contained in:
@ -57,7 +57,16 @@ class Month {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isGreater (startDate, endDate) {
|
isGreater (startDate, endDate) {
|
||||||
if (startDate.year > endDate.year) { return true } else if (startDate.year < endDate.year) { return false } else if (startDate.month > endDate.month) { return true } else if (startDate.month < endDate.month) { return false } else return true
|
if (startDate.year > endDate.year) {
|
||||||
|
return true
|
||||||
|
} else if (startDate.year < endDate.year) {
|
||||||
|
return false
|
||||||
|
} else if (startDate.month > endDate.month) {
|
||||||
|
return true
|
||||||
|
} else if (startDate.month < endDate.month) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
getDayDiff (startDate, endDate) {
|
getDayDiff (startDate, endDate) {
|
||||||
|
Reference in New Issue
Block a user