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

Public Member Functions

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

Detailed Description

Definition at line 33 of file peru.hpp.

Member Function Documentation

◆ name()

std::string name ( ) const
override

Definition at line 35 of file peru.hpp.

35{ return "Lima stock exchange"; }

◆ isBusinessDay()

bool isBusinessDay ( const Date &  date) const
override

Definition at line 29 of file peru.cpp.

29 {
30 Weekday w = date.weekday();
31 Day d = date.dayOfMonth(), dd = date.dayOfYear();
32 Month m = date.month();
33 Year y = date.year();
34 Day em = easterMonday(y);
35 if (isWeekend(w)
36 // New Years
37 || (d == 1 && m == January)
38 // if New Years on Thurs, get Fri off too
39 || (d == 2 && w == Friday && m == January)
40 // Maundy Thursday
41 || (dd == em - 4)
42 // Good Friday
43 || (dd == em - 3)
44 // Labour Day
45 || (d == 1 && m == May)
46 // Saint Peter and Saint Paul
47 || (d == 29 && m == June)
48 // Independence Day
49 || ((d == 28 || (d == 27 && w == Friday) || (d == 29 && w == Monday)) && m == July)
50 // if Ind Day on Thurs, get Fri off too
51 || (d == 29 && w == Friday && m == July)
52 // Santa Rosa de Lima
53 || (d == 30 && m == August)
54 // if SR on Thurs, get Fri off too
55 || (d == 31 && w == Friday && m == August)
56 // Battle of Angamos
57 || (d == 8 && m == October)
58 // All Saints Day
59 || (d == 1 && m == November)
60 // if Saints Day on Thurs, get Fri off too
61 || (d == 2 && w == Friday && m == November)
62 // Immaculate Conception
63 || (d == 8 && m == December)
64 // Christmas
65 || (d == 25 && m == December))
66 return false;
67 return true;
68}