MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / getFixedHolidays

Function getFixedHolidays

tests/helpers/feriados/index.js:83–145  ·  view source on GitHub ↗
(year, holidaysName = fixedHolidaysName)

Source from the content-addressed store, hash-verified

81 ].filter(({ name }) => holidaysName.includes(name));
82
83const getFixedHolidays = (year, holidaysName = fixedHolidaysName) => {
84 const holidays = [
85 {
86 date: `${year}-01-01`,
87 name: 'Confraternização mundial',
88 type: 'national',
89 weekday: getWeekdayName(`${year}-01-01`),
90 },
91 {
92 date: `${year}-04-21`,
93 name: 'Tiradentes',
94 type: 'national',
95 weekday: getWeekdayName(`${year}-04-21`),
96 },
97 {
98 date: `${year}-05-01`,
99 name: 'Dia do trabalho',
100 type: 'national',
101 weekday: getWeekdayName(`${year}-05-01`),
102 },
103 {
104 date: `${year}-09-07`,
105 name: 'Independência do Brasil',
106 type: 'national',
107 weekday: getWeekdayName(`${year}-09-07`),
108 },
109 {
110 date: `${year}-10-12`,
111 name: 'Nossa Senhora Aparecida',
112 type: 'national',
113 weekday: getWeekdayName(`${year}-10-12`),
114 },
115 {
116 date: `${year}-11-02`,
117 name: 'Finados',
118 type: 'national',
119 weekday: getWeekdayName(`${year}-11-02`),
120 },
121 {
122 date: `${year}-11-15`,
123 name: 'Proclamação da República',
124 type: 'national',
125 weekday: getWeekdayName(`${year}-11-15`),
126 },
127 {
128 date: `${year}-12-25`,
129 name: 'Natal',
130 type: 'national',
131 weekday: getWeekdayName(`${year}-12-25`),
132 },
133 ];
134
135 if (year >= 2024) {
136 holidays.splice(holidays.length - 1, 0, {
137 date: `${year}-11-20`,
138 name: 'Dia da consciência negra',
139 type: 'national',
140 weekday: getWeekdayName(`${year}-11-20`),

Callers 2

getHolidaysFunction · 0.85

Calls 1

getWeekdayNameFunction · 0.70

Tested by

no test coverage detected