colombian-holidays 5.0.7 → 5.0.8
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 +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -15
- package/dist/index.mjs +15 -15
- package/package.json +41 -46
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://badge.fury.io/js/colombian-holidays)
|
4
4
|
|
5
|
-
TypeScript module to
|
5
|
+
TypeScript module to get colombian holidays for any given year.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
package/dist/index.d.mts
CHANGED
@@ -21,8 +21,6 @@ declare function getHolidaysForYear(year: number, options?: {
|
|
21
21
|
valueAsDate: true;
|
22
22
|
}): ColombianHolidayWithNativeDate[];
|
23
23
|
|
24
|
-
declare function isHoliday(date: Date): boolean;
|
25
|
-
|
26
24
|
declare function holidaysWithinInterval(options: {
|
27
25
|
start: Date;
|
28
26
|
end: Date;
|
@@ -39,6 +37,8 @@ declare function holidaysWithinInterval(options: {
|
|
39
37
|
valueAsDate?: boolean;
|
40
38
|
}): ColombianHoliday[] | ColombianHolidayWithNativeDate[];
|
41
39
|
|
40
|
+
declare function isHoliday(date: Date): boolean;
|
41
|
+
|
42
42
|
declare const FIRST_HOLIDAY_YEAR = 1583;
|
43
43
|
declare const LAST_HOLIDAY_YEAR = 4099;
|
44
44
|
type MonthNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
package/dist/index.d.ts
CHANGED
@@ -21,8 +21,6 @@ declare function getHolidaysForYear(year: number, options?: {
|
|
21
21
|
valueAsDate: true;
|
22
22
|
}): ColombianHolidayWithNativeDate[];
|
23
23
|
|
24
|
-
declare function isHoliday(date: Date): boolean;
|
25
|
-
|
26
24
|
declare function holidaysWithinInterval(options: {
|
27
25
|
start: Date;
|
28
26
|
end: Date;
|
@@ -39,6 +37,8 @@ declare function holidaysWithinInterval(options: {
|
|
39
37
|
valueAsDate?: boolean;
|
40
38
|
}): ColombianHoliday[] | ColombianHolidayWithNativeDate[];
|
41
39
|
|
40
|
+
declare function isHoliday(date: Date): boolean;
|
41
|
+
|
42
42
|
declare const FIRST_HOLIDAY_YEAR = 1583;
|
43
43
|
declare const LAST_HOLIDAY_YEAR = 4099;
|
44
44
|
type MonthNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
package/dist/index.js
CHANGED
@@ -251,21 +251,6 @@ function getHolidaysForYear(year, { valueAsDate = false } = {}) {
|
|
251
251
|
return holidays;
|
252
252
|
}
|
253
253
|
|
254
|
-
// src/utils/helpers.ts
|
255
|
-
function isSameDate(date1, date2) {
|
256
|
-
return date1.getUTCDate() === date2.getUTCDate() && date1.getUTCMonth() === date2.getUTCMonth() && date1.getUTCFullYear() === date2.getUTCFullYear();
|
257
|
-
}
|
258
|
-
|
259
|
-
// src/utils/isHoliday.ts
|
260
|
-
function isHoliday(date) {
|
261
|
-
const holidays = getHolidaysForYear(date.getUTCFullYear(), {
|
262
|
-
valueAsDate: true
|
263
|
-
});
|
264
|
-
return holidays.some(
|
265
|
-
({ celebrationDate }) => isSameDate(celebrationDate, date)
|
266
|
-
);
|
267
|
-
}
|
268
|
-
|
269
254
|
// src/utils/holidaysWithinInterval.ts
|
270
255
|
function holidaysWithinInterval({
|
271
256
|
start,
|
@@ -294,6 +279,21 @@ function holidaysWithinInterval({
|
|
294
279
|
}));
|
295
280
|
}
|
296
281
|
|
282
|
+
// src/utils/helpers.ts
|
283
|
+
function isSameDate(date1, date2) {
|
284
|
+
return date1.getUTCDate() === date2.getUTCDate() && date1.getUTCMonth() === date2.getUTCMonth() && date1.getUTCFullYear() === date2.getUTCFullYear();
|
285
|
+
}
|
286
|
+
|
287
|
+
// src/utils/isHoliday.ts
|
288
|
+
function isHoliday(date) {
|
289
|
+
const holidays = getHolidaysForYear(date.getUTCFullYear(), {
|
290
|
+
valueAsDate: true
|
291
|
+
});
|
292
|
+
return holidays.some(
|
293
|
+
({ celebrationDate }) => isSameDate(celebrationDate, date)
|
294
|
+
);
|
295
|
+
}
|
296
|
+
|
297
297
|
// src/index.ts
|
298
298
|
var FIRST_HOLIDAY_YEAR = 1583;
|
299
299
|
var LAST_HOLIDAY_YEAR = 4099;
|
package/dist/index.mjs
CHANGED
@@ -209,21 +209,6 @@ function getHolidaysForYear(year, { valueAsDate = false } = {}) {
|
|
209
209
|
return holidays;
|
210
210
|
}
|
211
211
|
|
212
|
-
// src/utils/helpers.ts
|
213
|
-
function isSameDate(date1, date2) {
|
214
|
-
return date1.getUTCDate() === date2.getUTCDate() && date1.getUTCMonth() === date2.getUTCMonth() && date1.getUTCFullYear() === date2.getUTCFullYear();
|
215
|
-
}
|
216
|
-
|
217
|
-
// src/utils/isHoliday.ts
|
218
|
-
function isHoliday(date) {
|
219
|
-
const holidays = getHolidaysForYear(date.getUTCFullYear(), {
|
220
|
-
valueAsDate: true
|
221
|
-
});
|
222
|
-
return holidays.some(
|
223
|
-
({ celebrationDate }) => isSameDate(celebrationDate, date)
|
224
|
-
);
|
225
|
-
}
|
226
|
-
|
227
212
|
// src/utils/holidaysWithinInterval.ts
|
228
213
|
function holidaysWithinInterval({
|
229
214
|
start,
|
@@ -252,6 +237,21 @@ function holidaysWithinInterval({
|
|
252
237
|
}));
|
253
238
|
}
|
254
239
|
|
240
|
+
// src/utils/helpers.ts
|
241
|
+
function isSameDate(date1, date2) {
|
242
|
+
return date1.getUTCDate() === date2.getUTCDate() && date1.getUTCMonth() === date2.getUTCMonth() && date1.getUTCFullYear() === date2.getUTCFullYear();
|
243
|
+
}
|
244
|
+
|
245
|
+
// src/utils/isHoliday.ts
|
246
|
+
function isHoliday(date) {
|
247
|
+
const holidays = getHolidaysForYear(date.getUTCFullYear(), {
|
248
|
+
valueAsDate: true
|
249
|
+
});
|
250
|
+
return holidays.some(
|
251
|
+
({ celebrationDate }) => isSameDate(celebrationDate, date)
|
252
|
+
);
|
253
|
+
}
|
254
|
+
|
255
255
|
// src/index.ts
|
256
256
|
var FIRST_HOLIDAY_YEAR = 1583;
|
257
257
|
var LAST_HOLIDAY_YEAR = 4099;
|
package/package.json
CHANGED
@@ -1,48 +1,43 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
"url": "https://github.com/MauricioRobayo/colombian-holidays.git"
|
44
|
-
},
|
45
|
-
"release": {
|
46
|
-
"branches": "main"
|
47
|
-
}
|
2
|
+
"name": "colombian-holidays",
|
3
|
+
"version": "5.0.8",
|
4
|
+
"description": "Colombian holidays",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"scripts": {
|
8
|
+
"format": "biome format --write",
|
9
|
+
"lint": "biome lint --write",
|
10
|
+
"test": "vitest run",
|
11
|
+
"build": "tsup src/index.ts --dts --format cjs,esm --out-dir dist",
|
12
|
+
"prepublishOnly": "biome check && npm test && npm run build"
|
13
|
+
},
|
14
|
+
"license": "MIT",
|
15
|
+
"bugs": {
|
16
|
+
"url": "https://github.com/MauricioRobayo/colombian-holidays/issues"
|
17
|
+
},
|
18
|
+
"homepage": "https://github.com/MauricioRobayo/colombian-holidays",
|
19
|
+
"author": "Mauricio Robayo <rfmajo@gmail.com> (https://www.mauriciorobayo.com)",
|
20
|
+
"keywords": [
|
21
|
+
"Colombian holidays",
|
22
|
+
"Festivos en Colombia",
|
23
|
+
"Colombia",
|
24
|
+
"Festivos",
|
25
|
+
"Holidays"
|
26
|
+
],
|
27
|
+
"devDependencies": {
|
28
|
+
"@biomejs/biome": "2.1.3",
|
29
|
+
"tsup": "^8.5.0",
|
30
|
+
"typescript": "^5.9.2",
|
31
|
+
"vitest": "^3.2.4"
|
32
|
+
},
|
33
|
+
"dependencies": {
|
34
|
+
"pascua": "^2.1.13"
|
35
|
+
},
|
36
|
+
"files": [
|
37
|
+
"dist"
|
38
|
+
],
|
39
|
+
"repository": {
|
40
|
+
"type": "git",
|
41
|
+
"url": "https://github.com/MauricioRobayo/colombian-holidays.git"
|
42
|
+
}
|
48
43
|
}
|