@apiverve/worldholidays 1.2.4 → 1.2.5
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/README.md +159 -96
- package/index.d.ts +9 -6
- package/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# World Holidays API
|
|
2
2
|
|
|
3
|
-
World Holidays lists public holidays and observances for any two-letter country code. It returns holiday dates,
|
|
3
|
+
World Holidays lists public holidays and observances for any two-letter country code, optionally for a state or region. It returns holiday dates, local and English names, day of week, event types and substitute-day flags, and can check whether a single date is a holiday.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@apiverve/worldholidays)
|
|
6
6
|
|
|
@@ -58,7 +58,10 @@ Using the API is simple. All you have to do is make a request. The API will retu
|
|
|
58
58
|
```javascript
|
|
59
59
|
var query = {
|
|
60
60
|
country: "US",
|
|
61
|
-
year: 2026
|
|
61
|
+
year: 2026,
|
|
62
|
+
region: "CA",
|
|
63
|
+
type: "public",
|
|
64
|
+
date: "2026-07-03"
|
|
62
65
|
};
|
|
63
66
|
|
|
64
67
|
api.execute(query, function (error, data) {
|
|
@@ -79,7 +82,10 @@ You can also use promises to make requests. The API returns a promise that you c
|
|
|
79
82
|
```javascript
|
|
80
83
|
var query = {
|
|
81
84
|
country: "US",
|
|
82
|
-
year: 2026
|
|
85
|
+
year: 2026,
|
|
86
|
+
region: "CA",
|
|
87
|
+
type: "public",
|
|
88
|
+
date: "2026-07-03"
|
|
83
89
|
};
|
|
84
90
|
|
|
85
91
|
api.execute(query)
|
|
@@ -101,7 +107,10 @@ You can also use async/await to make requests. The API returns a promise that yo
|
|
|
101
107
|
async function makeRequest() {
|
|
102
108
|
var query = {
|
|
103
109
|
country: "US",
|
|
104
|
-
year: 2026
|
|
110
|
+
year: 2026,
|
|
111
|
+
region: "CA",
|
|
112
|
+
type: "public",
|
|
113
|
+
date: "2026-07-03"
|
|
105
114
|
};
|
|
106
115
|
|
|
107
116
|
try {
|
|
@@ -123,161 +132,215 @@ async function makeRequest() {
|
|
|
123
132
|
"error": null,
|
|
124
133
|
"data": {
|
|
125
134
|
"country": "US",
|
|
126
|
-
"year":
|
|
135
|
+
"year": 2026,
|
|
127
136
|
"holidays": [
|
|
128
137
|
{
|
|
129
|
-
"date": "
|
|
130
|
-
"start": "
|
|
131
|
-
"end": "
|
|
138
|
+
"date": "2026-01-01 00:00:00",
|
|
139
|
+
"start": "2026-01-01T05:00:00.000Z",
|
|
140
|
+
"end": "2026-01-02T05:00:00.000Z",
|
|
132
141
|
"name": "New Year's Day",
|
|
133
|
-
"type": "public"
|
|
142
|
+
"type": "public",
|
|
143
|
+
"dayOfWeek": "Thursday",
|
|
144
|
+
"englishName": "New Year's Day"
|
|
134
145
|
},
|
|
135
146
|
{
|
|
136
|
-
"date": "
|
|
137
|
-
"start": "
|
|
138
|
-
"end": "
|
|
147
|
+
"date": "2026-01-19 00:00:00",
|
|
148
|
+
"start": "2026-01-19T05:00:00.000Z",
|
|
149
|
+
"end": "2026-01-20T05:00:00.000Z",
|
|
139
150
|
"name": "Martin Luther King Jr. Day",
|
|
140
|
-
"type": "public"
|
|
151
|
+
"type": "public",
|
|
152
|
+
"dayOfWeek": "Monday",
|
|
153
|
+
"englishName": "Martin Luther King Jr. Day"
|
|
141
154
|
},
|
|
142
155
|
{
|
|
143
|
-
"date": "
|
|
144
|
-
"start": "
|
|
145
|
-
"end": "
|
|
156
|
+
"date": "2026-02-14 00:00:00",
|
|
157
|
+
"start": "2026-02-14T05:00:00.000Z",
|
|
158
|
+
"end": "2026-02-15T05:00:00.000Z",
|
|
146
159
|
"name": "Valentine's Day",
|
|
147
|
-
"type": "observance"
|
|
160
|
+
"type": "observance",
|
|
161
|
+
"dayOfWeek": "Saturday",
|
|
162
|
+
"englishName": "Valentine's Day"
|
|
148
163
|
},
|
|
149
164
|
{
|
|
150
|
-
"date": "
|
|
151
|
-
"start": "
|
|
152
|
-
"end": "
|
|
165
|
+
"date": "2026-02-16 00:00:00",
|
|
166
|
+
"start": "2026-02-16T05:00:00.000Z",
|
|
167
|
+
"end": "2026-02-17T05:00:00.000Z",
|
|
153
168
|
"name": "Washington's Birthday",
|
|
154
|
-
"type": "public"
|
|
169
|
+
"type": "public",
|
|
170
|
+
"dayOfWeek": "Monday",
|
|
171
|
+
"englishName": "Washington's Birthday"
|
|
155
172
|
},
|
|
156
173
|
{
|
|
157
|
-
"date": "
|
|
158
|
-
"start": "
|
|
159
|
-
"end": "
|
|
174
|
+
"date": "2026-03-17 00:00:00",
|
|
175
|
+
"start": "2026-03-17T04:00:00.000Z",
|
|
176
|
+
"end": "2026-03-18T04:00:00.000Z",
|
|
160
177
|
"name": "St. Patrick's Day",
|
|
161
|
-
"type": "observance"
|
|
178
|
+
"type": "observance",
|
|
179
|
+
"dayOfWeek": "Tuesday",
|
|
180
|
+
"englishName": "St. Patrick's Day"
|
|
162
181
|
},
|
|
163
182
|
{
|
|
164
|
-
"date": "
|
|
165
|
-
"start": "
|
|
166
|
-
"end": "
|
|
167
|
-
"name": "
|
|
168
|
-
"type": "observance"
|
|
183
|
+
"date": "2026-04-05 00:00:00",
|
|
184
|
+
"start": "2026-04-05T04:00:00.000Z",
|
|
185
|
+
"end": "2026-04-06T04:00:00.000Z",
|
|
186
|
+
"name": "Easter Sunday",
|
|
187
|
+
"type": "observance",
|
|
188
|
+
"dayOfWeek": "Sunday",
|
|
189
|
+
"englishName": "Easter Sunday"
|
|
169
190
|
},
|
|
170
191
|
{
|
|
171
|
-
"date": "
|
|
172
|
-
"start": "
|
|
173
|
-
"end": "
|
|
174
|
-
"name": "
|
|
175
|
-
"type": "observance"
|
|
192
|
+
"date": "2026-04-15 00:00:00",
|
|
193
|
+
"start": "2026-04-15T04:00:00.000Z",
|
|
194
|
+
"end": "2026-04-16T04:00:00.000Z",
|
|
195
|
+
"name": "Tax Day",
|
|
196
|
+
"type": "observance",
|
|
197
|
+
"dayOfWeek": "Wednesday",
|
|
198
|
+
"englishName": "Tax Day"
|
|
176
199
|
},
|
|
177
200
|
{
|
|
178
|
-
"date": "
|
|
179
|
-
"start": "
|
|
180
|
-
"end": "
|
|
201
|
+
"date": "2026-04-22 00:00:00",
|
|
202
|
+
"start": "2026-04-22T04:00:00.000Z",
|
|
203
|
+
"end": "2026-04-23T04:00:00.000Z",
|
|
181
204
|
"name": "Administrative Professionals Day",
|
|
182
|
-
"type": "observance"
|
|
205
|
+
"type": "observance",
|
|
206
|
+
"dayOfWeek": "Wednesday",
|
|
207
|
+
"englishName": "Administrative Professionals Day"
|
|
183
208
|
},
|
|
184
209
|
{
|
|
185
|
-
"date": "
|
|
186
|
-
"start": "
|
|
187
|
-
"end": "
|
|
210
|
+
"date": "2026-05-10 00:00:00",
|
|
211
|
+
"start": "2026-05-10T04:00:00.000Z",
|
|
212
|
+
"end": "2026-05-11T04:00:00.000Z",
|
|
188
213
|
"name": "Mother's Day",
|
|
189
|
-
"type": "observance"
|
|
214
|
+
"type": "observance",
|
|
215
|
+
"dayOfWeek": "Sunday",
|
|
216
|
+
"englishName": "Mother's Day"
|
|
190
217
|
},
|
|
191
218
|
{
|
|
192
|
-
"date": "
|
|
193
|
-
"start": "
|
|
194
|
-
"end": "
|
|
219
|
+
"date": "2026-05-25 00:00:00",
|
|
220
|
+
"start": "2026-05-25T04:00:00.000Z",
|
|
221
|
+
"end": "2026-05-26T04:00:00.000Z",
|
|
195
222
|
"name": "Memorial Day",
|
|
196
|
-
"type": "public"
|
|
223
|
+
"type": "public",
|
|
224
|
+
"dayOfWeek": "Monday",
|
|
225
|
+
"englishName": "Memorial Day"
|
|
197
226
|
},
|
|
198
227
|
{
|
|
199
|
-
"date": "
|
|
200
|
-
"start": "
|
|
201
|
-
"end": "
|
|
228
|
+
"date": "2026-06-19 00:00:00",
|
|
229
|
+
"start": "2026-06-19T04:00:00.000Z",
|
|
230
|
+
"end": "2026-06-20T04:00:00.000Z",
|
|
231
|
+
"name": "Juneteenth",
|
|
232
|
+
"type": "public",
|
|
233
|
+
"dayOfWeek": "Friday",
|
|
234
|
+
"englishName": "Juneteenth"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"date": "2026-06-21 00:00:00",
|
|
238
|
+
"start": "2026-06-21T04:00:00.000Z",
|
|
239
|
+
"end": "2026-06-22T04:00:00.000Z",
|
|
202
240
|
"name": "Father's Day",
|
|
203
|
-
"type": "observance"
|
|
241
|
+
"type": "observance",
|
|
242
|
+
"dayOfWeek": "Sunday",
|
|
243
|
+
"englishName": "Father's Day"
|
|
204
244
|
},
|
|
205
245
|
{
|
|
206
|
-
"date": "
|
|
207
|
-
"start": "
|
|
208
|
-
"end": "
|
|
209
|
-
"name": "
|
|
210
|
-
"type": "public"
|
|
246
|
+
"date": "2026-07-03 00:00:00",
|
|
247
|
+
"start": "2026-07-03T04:00:00.000Z",
|
|
248
|
+
"end": "2026-07-04T04:00:00.000Z",
|
|
249
|
+
"name": "Independence Day (substitute day)",
|
|
250
|
+
"type": "public",
|
|
251
|
+
"substitute": true,
|
|
252
|
+
"dayOfWeek": "Friday",
|
|
253
|
+
"englishName": "Independence Day (substitute day)"
|
|
211
254
|
},
|
|
212
255
|
{
|
|
213
|
-
"date": "
|
|
214
|
-
"start": "
|
|
215
|
-
"end": "
|
|
256
|
+
"date": "2026-07-04 00:00:00",
|
|
257
|
+
"start": "2026-07-04T04:00:00.000Z",
|
|
258
|
+
"end": "2026-07-05T04:00:00.000Z",
|
|
216
259
|
"name": "Independence Day",
|
|
217
|
-
"type": "public"
|
|
260
|
+
"type": "public",
|
|
261
|
+
"dayOfWeek": "Saturday",
|
|
262
|
+
"englishName": "Independence Day"
|
|
218
263
|
},
|
|
219
264
|
{
|
|
220
|
-
"date": "
|
|
221
|
-
"start": "
|
|
222
|
-
"end": "
|
|
265
|
+
"date": "2026-09-07 00:00:00",
|
|
266
|
+
"start": "2026-09-07T04:00:00.000Z",
|
|
267
|
+
"end": "2026-09-08T04:00:00.000Z",
|
|
223
268
|
"name": "Labor Day",
|
|
224
|
-
"type": "public"
|
|
269
|
+
"type": "public",
|
|
270
|
+
"dayOfWeek": "Monday",
|
|
271
|
+
"englishName": "Labour Day"
|
|
225
272
|
},
|
|
226
273
|
{
|
|
227
|
-
"date": "
|
|
228
|
-
"start": "
|
|
229
|
-
"end": "
|
|
274
|
+
"date": "2026-10-12 00:00:00",
|
|
275
|
+
"start": "2026-10-12T04:00:00.000Z",
|
|
276
|
+
"end": "2026-10-13T04:00:00.000Z",
|
|
230
277
|
"name": "Columbus Day",
|
|
231
|
-
"type": "public"
|
|
278
|
+
"type": "public",
|
|
279
|
+
"dayOfWeek": "Monday",
|
|
280
|
+
"englishName": "Columbus Day"
|
|
232
281
|
},
|
|
233
282
|
{
|
|
234
|
-
"date": "
|
|
235
|
-
"start": "
|
|
236
|
-
"end": "
|
|
283
|
+
"date": "2026-10-31 18:00:00",
|
|
284
|
+
"start": "2026-10-31T22:00:00.000Z",
|
|
285
|
+
"end": "2026-11-01T04:00:00.000Z",
|
|
237
286
|
"name": "Halloween",
|
|
238
|
-
"type": "observance"
|
|
287
|
+
"type": "observance",
|
|
288
|
+
"dayOfWeek": "Saturday",
|
|
289
|
+
"englishName": "Halloween"
|
|
239
290
|
},
|
|
240
291
|
{
|
|
241
|
-
"date": "
|
|
242
|
-
"start": "
|
|
243
|
-
"end": "
|
|
292
|
+
"date": "2026-11-11 00:00:00",
|
|
293
|
+
"start": "2026-11-11T05:00:00.000Z",
|
|
294
|
+
"end": "2026-11-12T05:00:00.000Z",
|
|
244
295
|
"name": "Veterans Day",
|
|
245
|
-
"type": "public"
|
|
296
|
+
"type": "public",
|
|
297
|
+
"dayOfWeek": "Wednesday",
|
|
298
|
+
"englishName": "Veterans Day"
|
|
246
299
|
},
|
|
247
300
|
{
|
|
248
|
-
"date": "
|
|
249
|
-
"start": "
|
|
250
|
-
"end": "
|
|
301
|
+
"date": "2026-11-26 00:00:00",
|
|
302
|
+
"start": "2026-11-26T05:00:00.000Z",
|
|
303
|
+
"end": "2026-11-27T05:00:00.000Z",
|
|
251
304
|
"name": "Thanksgiving Day",
|
|
252
|
-
"type": "public"
|
|
305
|
+
"type": "public",
|
|
306
|
+
"dayOfWeek": "Thursday",
|
|
307
|
+
"englishName": "Thanksgiving Day"
|
|
253
308
|
},
|
|
254
309
|
{
|
|
255
|
-
"date": "
|
|
256
|
-
"start": "
|
|
257
|
-
"end": "
|
|
310
|
+
"date": "2026-11-27 00:00:00",
|
|
311
|
+
"start": "2026-11-27T05:00:00.000Z",
|
|
312
|
+
"end": "2026-11-28T05:00:00.000Z",
|
|
258
313
|
"name": "Day after Thanksgiving Day",
|
|
259
|
-
"type": "observance"
|
|
314
|
+
"type": "observance",
|
|
315
|
+
"dayOfWeek": "Friday",
|
|
316
|
+
"englishName": "Day after Thanksgiving Day"
|
|
260
317
|
},
|
|
261
318
|
{
|
|
262
|
-
"date": "
|
|
263
|
-
"start": "
|
|
264
|
-
"end": "
|
|
319
|
+
"date": "2026-12-24 00:00:00",
|
|
320
|
+
"start": "2026-12-24T05:00:00.000Z",
|
|
321
|
+
"end": "2026-12-25T05:00:00.000Z",
|
|
265
322
|
"name": "Christmas Eve",
|
|
266
|
-
"type": "optional"
|
|
323
|
+
"type": "optional",
|
|
324
|
+
"dayOfWeek": "Thursday",
|
|
325
|
+
"englishName": "Christmas Eve"
|
|
267
326
|
},
|
|
268
327
|
{
|
|
269
|
-
"date": "
|
|
270
|
-
"start": "
|
|
271
|
-
"end": "
|
|
328
|
+
"date": "2026-12-25 00:00:00",
|
|
329
|
+
"start": "2026-12-25T05:00:00.000Z",
|
|
330
|
+
"end": "2026-12-26T05:00:00.000Z",
|
|
272
331
|
"name": "Christmas Day",
|
|
273
|
-
"type": "public"
|
|
332
|
+
"type": "public",
|
|
333
|
+
"dayOfWeek": "Friday",
|
|
334
|
+
"englishName": "Christmas Day"
|
|
274
335
|
},
|
|
275
336
|
{
|
|
276
|
-
"date": "
|
|
277
|
-
"start": "
|
|
278
|
-
"end": "
|
|
337
|
+
"date": "2026-12-31 00:00:00",
|
|
338
|
+
"start": "2026-12-31T05:00:00.000Z",
|
|
339
|
+
"end": "2027-01-01T05:00:00.000Z",
|
|
279
340
|
"name": "New Year's Eve",
|
|
280
|
-
"type": "observance"
|
|
341
|
+
"type": "observance",
|
|
342
|
+
"dayOfWeek": "Thursday",
|
|
343
|
+
"englishName": "New Year's Eve"
|
|
281
344
|
}
|
|
282
345
|
]
|
|
283
346
|
}
|
package/index.d.ts
CHANGED
|
@@ -26,16 +26,19 @@ declare module '@apiverve/worldholidays' {
|
|
|
26
26
|
|
|
27
27
|
interface WorldHolidaysData {
|
|
28
28
|
country: null | string;
|
|
29
|
-
year:
|
|
29
|
+
year: number | null;
|
|
30
30
|
holidays: Holiday[];
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
interface Holiday {
|
|
34
|
-
date:
|
|
35
|
-
start:
|
|
36
|
-
end:
|
|
37
|
-
name:
|
|
38
|
-
type:
|
|
34
|
+
date: Date | null;
|
|
35
|
+
start: Date | null;
|
|
36
|
+
end: Date | null;
|
|
37
|
+
name: null | string;
|
|
38
|
+
type: Type | null;
|
|
39
|
+
dayOfWeek: null | string;
|
|
40
|
+
englishName: null | string;
|
|
41
|
+
substitute?: boolean | null;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
enum Type {
|
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@ class worldholidaysWrapper {
|
|
|
30
30
|
this.baseURL = 'https://api.apiverve.com/v1/worldholidays';
|
|
31
31
|
|
|
32
32
|
// Validation rules for parameters (generated from schema)
|
|
33
|
-
this.validationRules = {"country":{"type":"string","required":true,"minLength":2,"maxLength":2},"year":{"type":"integer","required":false,"min":2000,"max":2050,"default":2026}};
|
|
33
|
+
this.validationRules = {"country":{"type":"string","required":true,"minLength":2,"maxLength":2},"year":{"type":"integer","required":false,"min":2000,"max":2050,"default":2026},"region":{"type":"string","required":false},"type":{"type":"string","required":false},"date":{"type":"string","required":false,"format":"date"}};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apiverve/worldholidays",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "World Holidays lists public holidays and observances for any two-letter country code. It returns holiday dates,
|
|
3
|
+
"version": "1.2.5",
|
|
4
|
+
"description": "World Holidays lists public holidays and observances for any two-letter country code, optionally for a state or region. It returns holiday dates, local and English names, day of week, event types and substitute-day flags, and can check whether a single date is a holiday.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"sideEffects": false,
|