es-regional-holidays 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +137 -1
- package/dist/index.d.mts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +708 -0
- package/dist/index.mjs +676 -0
- package/package.json +39 -17
- package/src/data/boe/boe_holidays_2026_raw.json +0 -452
- package/src/data/boe_holidays_2026_national_regional.json +0 -584
- package/src/index.ts +0 -2
- package/src/types.ts +0 -9
- package/tsconfig.json +0 -15
package/dist/index.js
ADDED
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
getAllHolidays: () => getAllHolidays,
|
|
24
|
+
getAllHolidaysByRegionCode: () => getAllHolidaysByRegionCode,
|
|
25
|
+
getAllRegions: () => getAllRegions,
|
|
26
|
+
getNationalHolidays: () => getNationalHolidays,
|
|
27
|
+
getRegionalHolidaysByRegionCode: () => getRegionalHolidaysByRegionCode,
|
|
28
|
+
isHoliday: () => isHoliday
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(index_exports);
|
|
31
|
+
|
|
32
|
+
// src/data/boe_holidays_2026_national_regional.json
|
|
33
|
+
var boe_holidays_2026_national_regional_default = {
|
|
34
|
+
source: "BOE-A-2025-21667",
|
|
35
|
+
year: 2026,
|
|
36
|
+
generated_at: "2026-01-02T21:40:46Z",
|
|
37
|
+
national: [
|
|
38
|
+
{
|
|
39
|
+
date: "2026-01-01",
|
|
40
|
+
name: "A\xF1o Nuevo",
|
|
41
|
+
scope: "national"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
date: "2026-04-03",
|
|
45
|
+
name: "Viernes Santo",
|
|
46
|
+
scope: "national"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
date: "2026-05-01",
|
|
50
|
+
name: "Fiesta del Trabajo",
|
|
51
|
+
scope: "national"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
date: "2026-08-15",
|
|
55
|
+
name: "Asunci\xF3n de la Virgen",
|
|
56
|
+
scope: "national"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
date: "2026-10-12",
|
|
60
|
+
name: "Fiesta Nacional de Espa\xF1a",
|
|
61
|
+
scope: "national"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
date: "2026-12-08",
|
|
65
|
+
name: "Inmaculada Concepci\xF3n",
|
|
66
|
+
scope: "national"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
date: "2026-12-25",
|
|
70
|
+
name: "Natividad del Se\xF1or",
|
|
71
|
+
scope: "national"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
regions: {
|
|
75
|
+
AN: {
|
|
76
|
+
regionName: "Andaluc\xEDa",
|
|
77
|
+
regional: [
|
|
78
|
+
{
|
|
79
|
+
date: "2026-01-06",
|
|
80
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
81
|
+
scope: "regional"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
date: "2026-02-28",
|
|
85
|
+
name: "D\xEDa de Andaluc\xEDa",
|
|
86
|
+
scope: "regional"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
date: "2026-04-02",
|
|
90
|
+
name: "Jueves Santo",
|
|
91
|
+
scope: "regional"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
date: "2026-11-02",
|
|
95
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
96
|
+
scope: "regional"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
date: "2026-12-07",
|
|
100
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
101
|
+
scope: "regional"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
AR: {
|
|
106
|
+
regionName: "Arag\xF3n",
|
|
107
|
+
regional: [
|
|
108
|
+
{
|
|
109
|
+
date: "2026-01-06",
|
|
110
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
111
|
+
scope: "regional"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
date: "2026-04-02",
|
|
115
|
+
name: "Jueves Santo",
|
|
116
|
+
scope: "regional"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
date: "2026-04-23",
|
|
120
|
+
name: "San Jorge/D\xEDa de Arag\xF3n",
|
|
121
|
+
scope: "regional"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
date: "2026-11-02",
|
|
125
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
126
|
+
scope: "regional"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
date: "2026-12-07",
|
|
130
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
131
|
+
scope: "regional"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
AS: {
|
|
136
|
+
regionName: "Asturias",
|
|
137
|
+
regional: [
|
|
138
|
+
{
|
|
139
|
+
date: "2026-01-06",
|
|
140
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
141
|
+
scope: "regional"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
date: "2026-04-02",
|
|
145
|
+
name: "Jueves Santo",
|
|
146
|
+
scope: "regional"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
date: "2026-09-08",
|
|
150
|
+
name: "D\xEDa de Asturias",
|
|
151
|
+
scope: "regional"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
date: "2026-11-02",
|
|
155
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
156
|
+
scope: "regional"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
date: "2026-12-07",
|
|
160
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
161
|
+
scope: "regional"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
CB: {
|
|
166
|
+
regionName: "Cantabria",
|
|
167
|
+
regional: [
|
|
168
|
+
{
|
|
169
|
+
date: "2026-01-06",
|
|
170
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
171
|
+
scope: "regional"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
date: "2026-04-02",
|
|
175
|
+
name: "Jueves Santo",
|
|
176
|
+
scope: "regional"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
date: "2026-07-28",
|
|
180
|
+
name: "D\xEDa de las Instituciones de Cantabria",
|
|
181
|
+
scope: "regional"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
date: "2026-09-15",
|
|
185
|
+
name: "La Bien Aparecida",
|
|
186
|
+
scope: "regional"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
date: "2026-12-07",
|
|
190
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
191
|
+
scope: "regional"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
CE: {
|
|
196
|
+
regionName: "Ciudad de Ceuta",
|
|
197
|
+
regional: [
|
|
198
|
+
{
|
|
199
|
+
date: "2026-01-06",
|
|
200
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
201
|
+
scope: "regional"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
date: "2026-04-02",
|
|
205
|
+
name: "Jueves Santo",
|
|
206
|
+
scope: "regional"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
date: "2026-05-27",
|
|
210
|
+
name: "Fiesta Sacrificio-Eidul Adha",
|
|
211
|
+
scope: "regional"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
date: "2026-08-05",
|
|
215
|
+
name: "Nuestra Se\xF1ora de \xC1frica",
|
|
216
|
+
scope: "regional"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
date: "2026-09-02",
|
|
220
|
+
name: "D\xEDa de Ceuta",
|
|
221
|
+
scope: "regional"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
CL: {
|
|
226
|
+
regionName: "Castilla y Le\xF3n",
|
|
227
|
+
regional: [
|
|
228
|
+
{
|
|
229
|
+
date: "2026-01-06",
|
|
230
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
231
|
+
scope: "regional"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
date: "2026-04-02",
|
|
235
|
+
name: "Jueves Santo",
|
|
236
|
+
scope: "regional"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
date: "2026-04-23",
|
|
240
|
+
name: "Fiesta de Castilla y Le\xF3n",
|
|
241
|
+
scope: "regional"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
date: "2026-11-02",
|
|
245
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
246
|
+
scope: "regional"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
date: "2026-12-07",
|
|
250
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
251
|
+
scope: "regional"
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
CM: {
|
|
256
|
+
regionName: "Castilla-La Mancha",
|
|
257
|
+
regional: [
|
|
258
|
+
{
|
|
259
|
+
date: "2026-01-06",
|
|
260
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
261
|
+
scope: "regional"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
date: "2026-04-02",
|
|
265
|
+
name: "Jueves Santo",
|
|
266
|
+
scope: "regional"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
date: "2026-04-06",
|
|
270
|
+
name: "Lunes de Pascua",
|
|
271
|
+
scope: "regional"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
date: "2026-06-04",
|
|
275
|
+
name: "Corpus Christi",
|
|
276
|
+
scope: "regional"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
date: "2026-11-02",
|
|
280
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
281
|
+
scope: "regional"
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
CN: {
|
|
286
|
+
regionName: "Canarias",
|
|
287
|
+
regional: [
|
|
288
|
+
{
|
|
289
|
+
date: "2026-01-06",
|
|
290
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
291
|
+
scope: "regional"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
date: "2026-04-02",
|
|
295
|
+
name: "Jueves Santo",
|
|
296
|
+
scope: "regional"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
date: "2026-05-30",
|
|
300
|
+
name: "D\xEDa de Canarias",
|
|
301
|
+
scope: "regional"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
date: "2026-11-02",
|
|
305
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
306
|
+
scope: "regional"
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
CT: {
|
|
311
|
+
regionName: "Catalu\xF1a",
|
|
312
|
+
regional: [
|
|
313
|
+
{
|
|
314
|
+
date: "2026-01-06",
|
|
315
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
316
|
+
scope: "regional"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
date: "2026-04-06",
|
|
320
|
+
name: "Lunes de Pascua",
|
|
321
|
+
scope: "regional"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
date: "2026-09-11",
|
|
325
|
+
name: "Fiesta Nacional de Catalu\xF1a",
|
|
326
|
+
scope: "regional"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
date: "2026-12-26",
|
|
330
|
+
name: "San Esteban",
|
|
331
|
+
scope: "regional"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
EX: {
|
|
336
|
+
regionName: "Extremadura",
|
|
337
|
+
regional: [
|
|
338
|
+
{
|
|
339
|
+
date: "2026-01-06",
|
|
340
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
341
|
+
scope: "regional"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
date: "2026-04-02",
|
|
345
|
+
name: "Jueves Santo",
|
|
346
|
+
scope: "regional"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
date: "2026-09-08",
|
|
350
|
+
name: "D\xEDa de Extremadura",
|
|
351
|
+
scope: "regional"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
date: "2026-11-02",
|
|
355
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
356
|
+
scope: "regional"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
date: "2026-12-07",
|
|
360
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
361
|
+
scope: "regional"
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
GA: {
|
|
366
|
+
regionName: "Galicia",
|
|
367
|
+
regional: [
|
|
368
|
+
{
|
|
369
|
+
date: "2026-01-06",
|
|
370
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
371
|
+
scope: "regional"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
date: "2026-03-19",
|
|
375
|
+
name: "San Jos\xE9",
|
|
376
|
+
scope: "regional"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
date: "2026-04-02",
|
|
380
|
+
name: "Jueves Santo",
|
|
381
|
+
scope: "regional"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
date: "2026-07-25",
|
|
385
|
+
name: "Santiago Ap\xF3stol/D\xEDa Nacional de Galicia",
|
|
386
|
+
scope: "regional"
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
},
|
|
390
|
+
IB: {
|
|
391
|
+
regionName: "Illes Balears",
|
|
392
|
+
regional: [
|
|
393
|
+
{
|
|
394
|
+
date: "2026-01-06",
|
|
395
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
396
|
+
scope: "regional"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
date: "2026-03-02",
|
|
400
|
+
name: "Lunes siguiente al D\xEDa de les Illes Balears",
|
|
401
|
+
scope: "regional"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
date: "2026-04-02",
|
|
405
|
+
name: "Jueves Santo",
|
|
406
|
+
scope: "regional"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
date: "2026-04-06",
|
|
410
|
+
name: "Lunes de Pascua",
|
|
411
|
+
scope: "regional"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
date: "2026-12-26",
|
|
415
|
+
name: "San Esteban",
|
|
416
|
+
scope: "regional"
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
420
|
+
MC: {
|
|
421
|
+
regionName: "Regi\xF3n Murcia",
|
|
422
|
+
regional: [
|
|
423
|
+
{
|
|
424
|
+
date: "2026-01-06",
|
|
425
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
426
|
+
scope: "regional"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
date: "2026-03-19",
|
|
430
|
+
name: "San Jos\xE9",
|
|
431
|
+
scope: "regional"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
date: "2026-04-02",
|
|
435
|
+
name: "Jueves Santo",
|
|
436
|
+
scope: "regional"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
date: "2026-12-07",
|
|
440
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
441
|
+
scope: "regional"
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
},
|
|
445
|
+
MD: {
|
|
446
|
+
regionName: "Com. Madrid",
|
|
447
|
+
regional: [
|
|
448
|
+
{
|
|
449
|
+
date: "2026-01-06",
|
|
450
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
451
|
+
scope: "regional"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
date: "2026-04-02",
|
|
455
|
+
name: "Jueves Santo",
|
|
456
|
+
scope: "regional"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
date: "2026-05-02",
|
|
460
|
+
name: "Fiesta de la Comunidad de Madrid",
|
|
461
|
+
scope: "regional"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
date: "2026-11-02",
|
|
465
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
466
|
+
scope: "regional"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
date: "2026-12-07",
|
|
470
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
471
|
+
scope: "regional"
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
},
|
|
475
|
+
ML: {
|
|
476
|
+
regionName: "Ciudad de Melilla",
|
|
477
|
+
regional: [
|
|
478
|
+
{
|
|
479
|
+
date: "2026-01-06",
|
|
480
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
481
|
+
scope: "regional"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
date: "2026-03-20",
|
|
485
|
+
name: "Fiesta del Eid Fitr",
|
|
486
|
+
scope: "regional"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
date: "2026-04-02",
|
|
490
|
+
name: "Jueves Santo",
|
|
491
|
+
scope: "regional"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
date: "2026-05-27",
|
|
495
|
+
name: "Fiesta Sacrificio-Aid al Adha",
|
|
496
|
+
scope: "regional"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
date: "2026-12-07",
|
|
500
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
501
|
+
scope: "regional"
|
|
502
|
+
}
|
|
503
|
+
]
|
|
504
|
+
},
|
|
505
|
+
NC: {
|
|
506
|
+
regionName: "C. Foral Navarra",
|
|
507
|
+
regional: [
|
|
508
|
+
{
|
|
509
|
+
date: "2026-01-06",
|
|
510
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
511
|
+
scope: "regional"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
date: "2026-03-19",
|
|
515
|
+
name: "San Jos\xE9",
|
|
516
|
+
scope: "regional"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
date: "2026-04-02",
|
|
520
|
+
name: "Jueves Santo",
|
|
521
|
+
scope: "regional"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
date: "2026-04-06",
|
|
525
|
+
name: "Lunes de Pascua",
|
|
526
|
+
scope: "regional"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
date: "2026-11-02",
|
|
530
|
+
name: "D\xEDa siguiente a Todos los Santos",
|
|
531
|
+
scope: "regional"
|
|
532
|
+
}
|
|
533
|
+
]
|
|
534
|
+
},
|
|
535
|
+
PV: {
|
|
536
|
+
regionName: "Pa\xEDs Vasco",
|
|
537
|
+
regional: [
|
|
538
|
+
{
|
|
539
|
+
date: "2026-01-06",
|
|
540
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
541
|
+
scope: "regional"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
date: "2026-03-19",
|
|
545
|
+
name: "San Jos\xE9",
|
|
546
|
+
scope: "regional"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
date: "2026-04-02",
|
|
550
|
+
name: "Jueves Santo",
|
|
551
|
+
scope: "regional"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
date: "2026-04-06",
|
|
555
|
+
name: "Lunes de Pascua",
|
|
556
|
+
scope: "regional"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
date: "2026-07-25",
|
|
560
|
+
name: "Santiago Ap\xF3stol/D\xEDa Nacional de Galicia",
|
|
561
|
+
scope: "regional"
|
|
562
|
+
}
|
|
563
|
+
]
|
|
564
|
+
},
|
|
565
|
+
RI: {
|
|
566
|
+
regionName: "La Rioja",
|
|
567
|
+
regional: [
|
|
568
|
+
{
|
|
569
|
+
date: "2026-01-06",
|
|
570
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
571
|
+
scope: "regional"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
date: "2026-04-02",
|
|
575
|
+
name: "Jueves Santo",
|
|
576
|
+
scope: "regional"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
date: "2026-04-06",
|
|
580
|
+
name: "Lunes de Pascua",
|
|
581
|
+
scope: "regional"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
date: "2026-12-07",
|
|
585
|
+
name: "Lunes siguiente al D\xEDa de la Constituci\xF3n Espa\xF1ola",
|
|
586
|
+
scope: "regional"
|
|
587
|
+
}
|
|
588
|
+
]
|
|
589
|
+
},
|
|
590
|
+
VC: {
|
|
591
|
+
regionName: "Comunitat Valenciana",
|
|
592
|
+
regional: [
|
|
593
|
+
{
|
|
594
|
+
date: "2026-01-06",
|
|
595
|
+
name: "Epifan\xEDa del Se\xF1or",
|
|
596
|
+
scope: "regional"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
date: "2026-03-19",
|
|
600
|
+
name: "San Jos\xE9",
|
|
601
|
+
scope: "regional"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
date: "2026-04-06",
|
|
605
|
+
name: "Lunes de Pascua",
|
|
606
|
+
scope: "regional"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
date: "2026-10-09",
|
|
610
|
+
name: "D\xEDa de la Comunitat Valenciana",
|
|
611
|
+
scope: "regional"
|
|
612
|
+
}
|
|
613
|
+
]
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// src/index.ts
|
|
619
|
+
var DATASETS = {
|
|
620
|
+
2026: boe_holidays_2026_national_regional_default
|
|
621
|
+
};
|
|
622
|
+
function getDataset(year) {
|
|
623
|
+
const y = year ?? 2026;
|
|
624
|
+
return DATASETS[y];
|
|
625
|
+
}
|
|
626
|
+
function sortHolidaysByDate(a, b) {
|
|
627
|
+
const byDate = a.date.localeCompare(b.date);
|
|
628
|
+
if (byDate !== 0) return byDate;
|
|
629
|
+
const byName = a.name.localeCompare(b.name);
|
|
630
|
+
if (byName !== 0) return byName;
|
|
631
|
+
return (a.region ?? "").localeCompare(b.region ?? "");
|
|
632
|
+
}
|
|
633
|
+
function getAllHolidays(year) {
|
|
634
|
+
const dataset = getDataset(year);
|
|
635
|
+
if (!dataset) return [];
|
|
636
|
+
const result = [];
|
|
637
|
+
for (const nationalHoliday of dataset.national) {
|
|
638
|
+
result.push({
|
|
639
|
+
date: nationalHoliday.date,
|
|
640
|
+
name: nationalHoliday.name,
|
|
641
|
+
scope: "national",
|
|
642
|
+
source: dataset.source
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
for (const [code, regionData] of Object.entries(dataset.regions)) {
|
|
646
|
+
for (const regionalHoliday of regionData.regional) {
|
|
647
|
+
result.push({
|
|
648
|
+
date: regionalHoliday.date,
|
|
649
|
+
name: regionalHoliday.name,
|
|
650
|
+
scope: "regional",
|
|
651
|
+
region: code,
|
|
652
|
+
regionName: regionData.regionName,
|
|
653
|
+
source: dataset.source
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return result.sort(sortHolidaysByDate);
|
|
658
|
+
}
|
|
659
|
+
function getNationalHolidays(year) {
|
|
660
|
+
const dataset = getDataset(year);
|
|
661
|
+
if (!dataset) return [];
|
|
662
|
+
return dataset.national.map((nationalHoliday) => ({
|
|
663
|
+
date: nationalHoliday.date,
|
|
664
|
+
name: nationalHoliday.name,
|
|
665
|
+
scope: "national",
|
|
666
|
+
source: dataset.source
|
|
667
|
+
}));
|
|
668
|
+
}
|
|
669
|
+
function getRegionalHolidaysByRegionCode(region, year) {
|
|
670
|
+
const dataset = getDataset(year);
|
|
671
|
+
if (!dataset) return [];
|
|
672
|
+
const regionData = dataset.regions[region];
|
|
673
|
+
if (!regionData) return [];
|
|
674
|
+
return regionData.regional.map((regionalHoliday) => ({
|
|
675
|
+
date: regionalHoliday.date,
|
|
676
|
+
name: regionalHoliday.name,
|
|
677
|
+
scope: "regional",
|
|
678
|
+
region,
|
|
679
|
+
regionName: regionData.regionName,
|
|
680
|
+
source: dataset.source
|
|
681
|
+
}));
|
|
682
|
+
}
|
|
683
|
+
function getAllHolidaysByRegionCode(region, year) {
|
|
684
|
+
const holidays = [
|
|
685
|
+
...getNationalHolidays(year),
|
|
686
|
+
...getRegionalHolidaysByRegionCode(region, year)
|
|
687
|
+
];
|
|
688
|
+
return holidays.sort(sortHolidaysByDate);
|
|
689
|
+
}
|
|
690
|
+
function isHoliday(date, region, year) {
|
|
691
|
+
const iso = date instanceof Date ? `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}` : date;
|
|
692
|
+
if (region) return getAllHolidaysByRegionCode(region, year).some((h) => h.date === iso);
|
|
693
|
+
return getNationalHolidays(year).some((h) => h.date === iso);
|
|
694
|
+
}
|
|
695
|
+
function getAllRegions(year) {
|
|
696
|
+
const dataset = getDataset(year);
|
|
697
|
+
if (!dataset) return [];
|
|
698
|
+
return Object.keys(dataset.regions).sort();
|
|
699
|
+
}
|
|
700
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
701
|
+
0 && (module.exports = {
|
|
702
|
+
getAllHolidays,
|
|
703
|
+
getAllHolidaysByRegionCode,
|
|
704
|
+
getAllRegions,
|
|
705
|
+
getNationalHolidays,
|
|
706
|
+
getRegionalHolidaysByRegionCode,
|
|
707
|
+
isHoliday
|
|
708
|
+
});
|