Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Switzerland::SettlementImpl Class Reference
+ Inheritance diagram for Switzerland::SettlementImpl:
+ Collaboration diagram for Switzerland::SettlementImpl:

Public Member Functions

std::string name () const override
 
bool isBusinessDay (const Date &) const override
 

Detailed Description

Definition at line 52 of file switzerland.hpp.

Member Function Documentation

◆ name()

std::string name ( ) const
override

Definition at line 54 of file switzerland.hpp.

54{ return "Switzerland"; }

◆ isBusinessDay()

bool isBusinessDay ( const Date &  date) const
override

Definition at line 40 of file switzerland.cpp.

40 {
41 Weekday w = date.weekday();
42 Day d = date.dayOfMonth(), dd = date.dayOfYear();
43 Month m = date.month();
44 Year y = date.year();
45 Day em = easterMonday(y);
46 if (isWeekend(w)
47 // New Year's Day
48 || (d == 1 && m == January)
49 // Berchtoldstag
50 || (d == 2 && m == January)
51 // Good Friday
52 || (dd == em - 3)
53 // Easter Monday
54 || (dd == em)
55 // Ascension Day
56 || (dd == em + 38)
57 // Whit Monday
58 || (dd == em + 49)
59 // Labour Day
60 || (d == 1 && m == May)
61 // National Day
62 || (d == 1 && m == August)
63 // Christmas
64 || (d == 25 && m == December)
65 // St. Stephen's Day
66 || (d == 26 && m == December))
67 return false;
68 return true;
69}