This simplifies the reading of bool isEasterMode()
This commit is contained in:
parent
25a4aa565a
commit
d21630c815
12
src/main.cpp
12
src/main.cpp
@ -395,9 +395,11 @@ void handleXmasMode()
|
||||
*/
|
||||
bool isEasterMode(int day, int month, int year, int before_after_days)
|
||||
{
|
||||
switch (UserConfigParams::m_easter_ear_mode)
|
||||
{
|
||||
case 0:
|
||||
if (UserConfigParams::m_easter_ear_mode == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (UserConfigParams::m_easter_ear_mode == 0)
|
||||
{
|
||||
// Compute Easter date, based on wikipedia formula
|
||||
// http://en.wikipedia.org/wiki/Computus
|
||||
@ -430,10 +432,8 @@ bool isEasterMode(int day, int month, int year, int before_after_days)
|
||||
return (month > easter_start_month || (month == easter_start_month && day >= easter_start_day)) &&
|
||||
(month < easter_end_month || (month == easter_end_month && day <= easter_end_day));
|
||||
}
|
||||
case 1: return true; break;
|
||||
default: return false; break;
|
||||
} // switch m_xmas_mode
|
||||
|
||||
return false;
|
||||
} // isEasterMode(day, month, year, before_after_days)
|
||||
|
||||
// ============================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user