indian-banking-holiday 1.0.0
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 +201 -0
- package/README.md +336 -0
- package/dist/index.d.mts +93 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +215 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +203 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indian states and union territories
|
|
3
|
+
*/
|
|
4
|
+
type IndianState = 'Andhra Pradesh' | 'Arunachal Pradesh' | 'Assam' | 'Bihar' | 'Chhattisgarh' | 'Goa' | 'Gujarat' | 'Haryana' | 'Himachal Pradesh' | 'Jharkhand' | 'Karnataka' | 'Kerala' | 'Madhya Pradesh' | 'Maharashtra' | 'Manipur' | 'Meghalaya' | 'Mizoram' | 'Nagaland' | 'Odisha' | 'Punjab' | 'Rajasthan' | 'Sikkim' | 'Tamil Nadu' | 'Telangana' | 'Tripura' | 'Uttar Pradesh' | 'Uttarakhand' | 'West Bengal' | 'Andaman and Nicobar Islands' | 'Chandigarh' | 'Dadra and Nagar Haveli and Daman and Diu' | 'Delhi' | 'Jammu and Kashmir' | 'Ladakh' | 'Lakshadweep' | 'Puducherry';
|
|
5
|
+
/**
|
|
6
|
+
* Holiday type
|
|
7
|
+
*/
|
|
8
|
+
type HolidayType = 'National' | 'State' | 'Regional';
|
|
9
|
+
/**
|
|
10
|
+
* Holiday information
|
|
11
|
+
*/
|
|
12
|
+
interface Holiday {
|
|
13
|
+
date: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: HolidayType;
|
|
16
|
+
states?: IndianState[];
|
|
17
|
+
description?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Query options for holiday lookup
|
|
21
|
+
*/
|
|
22
|
+
interface HolidayQueryOptions {
|
|
23
|
+
year?: number;
|
|
24
|
+
month?: number;
|
|
25
|
+
state?: IndianState;
|
|
26
|
+
startDate?: string;
|
|
27
|
+
endDate?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Holiday result with metadata
|
|
31
|
+
*/
|
|
32
|
+
interface HolidayResult {
|
|
33
|
+
holidays: Holiday[];
|
|
34
|
+
total: number;
|
|
35
|
+
query: HolidayQueryOptions;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get all banking holidays
|
|
40
|
+
*/
|
|
41
|
+
declare function getAllHolidays(): Holiday[];
|
|
42
|
+
/**
|
|
43
|
+
* Query holidays based on various filters
|
|
44
|
+
*/
|
|
45
|
+
declare function getHolidays(options?: HolidayQueryOptions): HolidayResult;
|
|
46
|
+
/**
|
|
47
|
+
* Get holidays for a specific year
|
|
48
|
+
*/
|
|
49
|
+
declare function getHolidaysByYear(year: number): Holiday[];
|
|
50
|
+
/**
|
|
51
|
+
* Get holidays for a specific month
|
|
52
|
+
*/
|
|
53
|
+
declare function getHolidaysByMonth(year: number, month: number): Holiday[];
|
|
54
|
+
/**
|
|
55
|
+
* Get holidays for a specific state
|
|
56
|
+
*/
|
|
57
|
+
declare function getHolidaysByState(state: IndianState, year?: number): Holiday[];
|
|
58
|
+
/**
|
|
59
|
+
* Get holidays for a date range
|
|
60
|
+
*/
|
|
61
|
+
declare function getHolidaysByDateRange(startDate: string, endDate: string, options?: Omit<HolidayQueryOptions, 'startDate' | 'endDate'>): Holiday[];
|
|
62
|
+
/**
|
|
63
|
+
* Check if a specific date is a banking holiday
|
|
64
|
+
* @param date - Date to check (string in YYYY-MM-DD format or Date object)
|
|
65
|
+
* @param state - Optional state filter
|
|
66
|
+
*/
|
|
67
|
+
declare function isHoliday(date: string | Date, state?: IndianState): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get holiday information for a specific date
|
|
70
|
+
* @param date - Date to check (string in YYYY-MM-DD format or Date object)
|
|
71
|
+
* @param state - Optional state filter
|
|
72
|
+
*/
|
|
73
|
+
declare function getHolidayByDate(date: string | Date, state?: IndianState): Holiday | null;
|
|
74
|
+
/**
|
|
75
|
+
* Get the next banking holiday from a given date
|
|
76
|
+
* @param fromDate - Starting date (defaults to today)
|
|
77
|
+
* @param state - Optional state filter
|
|
78
|
+
*/
|
|
79
|
+
declare function getNextHoliday(fromDate?: string | Date, state?: IndianState): Holiday | null;
|
|
80
|
+
/**
|
|
81
|
+
* Get upcoming holidays within a specified number of days
|
|
82
|
+
* @param days - Number of days to look ahead (default: 30)
|
|
83
|
+
* @param state - Optional state filter
|
|
84
|
+
*/
|
|
85
|
+
declare function getUpcomingHolidays(days?: number, state?: IndianState): Holiday[];
|
|
86
|
+
/**
|
|
87
|
+
* Get holidays count for a year
|
|
88
|
+
* @param year - Year to get count for
|
|
89
|
+
* @param state - Optional state filter
|
|
90
|
+
*/
|
|
91
|
+
declare function getHolidayCount(year: number, state?: IndianState): number;
|
|
92
|
+
|
|
93
|
+
export { type Holiday, type HolidayQueryOptions, type HolidayResult, type HolidayType, type IndianState, getAllHolidays, getHolidayByDate, getHolidayCount, getHolidays, getHolidaysByDateRange, getHolidaysByMonth, getHolidaysByState, getHolidaysByYear, getNextHoliday, getUpcomingHolidays, isHoliday };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/holidays.ts
|
|
4
|
+
var NATIONAL_HOLIDAYS = [
|
|
5
|
+
// Republic Day
|
|
6
|
+
{ date: "2025-01-26", name: "Republic Day", type: "National" },
|
|
7
|
+
{ date: "2026-01-26", name: "Republic Day", type: "National" },
|
|
8
|
+
{ date: "2027-01-26", name: "Republic Day", type: "National" },
|
|
9
|
+
// Independence Day
|
|
10
|
+
{ date: "2025-08-15", name: "Independence Day", type: "National" },
|
|
11
|
+
{ date: "2026-08-15", name: "Independence Day", type: "National" },
|
|
12
|
+
{ date: "2027-08-15", name: "Independence Day", type: "National" },
|
|
13
|
+
// Gandhi Jayanti
|
|
14
|
+
{ date: "2025-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
15
|
+
{ date: "2026-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
16
|
+
{ date: "2027-10-02", name: "Gandhi Jayanti", type: "National" }
|
|
17
|
+
];
|
|
18
|
+
var RELIGIOUS_HOLIDAYS = [
|
|
19
|
+
// 2025
|
|
20
|
+
{ date: "2025-01-14", name: "Makar Sankranti", type: "Regional", states: ["Gujarat", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
21
|
+
{ date: "2025-01-15", name: "Pongal", type: "State", states: ["Tamil Nadu"] },
|
|
22
|
+
{ date: "2025-01-26", name: "Republic Day", type: "National" },
|
|
23
|
+
{ date: "2025-03-08", name: "Holi", type: "Regional" },
|
|
24
|
+
{ date: "2025-03-29", name: "Good Friday", type: "Regional" },
|
|
25
|
+
{ date: "2025-04-14", name: "Ambedkar Jayanti", type: "Regional" },
|
|
26
|
+
{ date: "2025-04-14", name: "Vaisakhi", type: "State", states: ["Punjab", "Haryana"] },
|
|
27
|
+
{ date: "2025-04-17", name: "Ram Navami", type: "Regional" },
|
|
28
|
+
{ date: "2025-05-01", name: "Labour Day", type: "State", states: ["Maharashtra", "Karnataka", "Kerala", "Tamil Nadu"] },
|
|
29
|
+
{ date: "2025-06-17", name: "Eid ul-Fitr", type: "Regional" },
|
|
30
|
+
{ date: "2025-08-15", name: "Independence Day", type: "National" },
|
|
31
|
+
{ date: "2025-08-26", name: "Raksha Bandhan", type: "Regional" },
|
|
32
|
+
{ date: "2025-08-29", name: "Janmashtami", type: "Regional" },
|
|
33
|
+
{ date: "2025-09-07", name: "Ganesh Chaturthi", type: "State", states: ["Maharashtra", "Goa", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
34
|
+
{ date: "2025-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
35
|
+
{ date: "2025-10-12", name: "Dussehra", type: "Regional" },
|
|
36
|
+
{ date: "2025-10-20", name: "Eid ul-Adha", type: "Regional" },
|
|
37
|
+
{ date: "2025-10-31", name: "Diwali", type: "Regional" },
|
|
38
|
+
{ date: "2025-11-01", name: "Diwali", type: "Regional" },
|
|
39
|
+
{ date: "2025-11-15", name: "Guru Nanak Jayanti", type: "State", states: ["Punjab", "Haryana", "Himachal Pradesh"] },
|
|
40
|
+
{ date: "2025-12-25", name: "Christmas", type: "Regional" },
|
|
41
|
+
// 2026 - Updated based on HDFC Bank holiday list
|
|
42
|
+
{ date: "2026-01-14", name: "Makar Sankranti", type: "Regional", states: ["Gujarat", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
43
|
+
{ date: "2026-01-15", name: "Makar Sankranti", type: "Regional", states: ["Andhra Pradesh", "Karnataka"] },
|
|
44
|
+
{ date: "2026-01-15", name: "Pongal", type: "State", states: ["Tamil Nadu"] },
|
|
45
|
+
{ date: "2026-01-26", name: "Republic Day", type: "National" },
|
|
46
|
+
{ date: "2026-02-15", name: "Mahashivratri", type: "Regional" },
|
|
47
|
+
{ date: "2026-03-03", name: "Holi", type: "Regional" },
|
|
48
|
+
{ date: "2026-03-04", name: "Holi", type: "Regional" },
|
|
49
|
+
{ date: "2026-03-19", name: "Ugadi Festival", type: "State", states: ["Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
50
|
+
{ date: "2026-03-20", name: "Eid ul-Fitr", type: "Regional" },
|
|
51
|
+
{ date: "2026-03-21", name: "Eid ul-Fitr", type: "Regional" },
|
|
52
|
+
{ date: "2026-03-26", name: "Ram Navami", type: "Regional" },
|
|
53
|
+
{ date: "2026-03-27", name: "Ram Navami", type: "Regional" },
|
|
54
|
+
{ date: "2026-03-31", name: "Mahavir Jayanti", type: "Regional" },
|
|
55
|
+
{ date: "2026-04-03", name: "Good Friday", type: "Regional" },
|
|
56
|
+
{ date: "2026-04-14", name: "Ambedkar Jayanti", type: "Regional" },
|
|
57
|
+
{ date: "2026-04-14", name: "Vaisakhi", type: "State", states: ["Punjab", "Haryana"] },
|
|
58
|
+
{ date: "2026-05-01", name: "Labour Day", type: "State", states: ["Maharashtra", "Karnataka", "Kerala", "Tamil Nadu"] },
|
|
59
|
+
{ date: "2026-05-01", name: "Buddha Poornima", type: "Regional" },
|
|
60
|
+
{ date: "2026-05-27", name: "Eid ul-Adha", type: "Regional" },
|
|
61
|
+
{ date: "2026-05-28", name: "Eid ul-Adha", type: "Regional" },
|
|
62
|
+
{ date: "2026-06-26", name: "Moharram", type: "Regional" },
|
|
63
|
+
{ date: "2026-08-15", name: "Independence Day", type: "National" },
|
|
64
|
+
{ date: "2026-08-26", name: "Id A Milad", type: "Regional" },
|
|
65
|
+
{ date: "2026-08-28", name: "Raksha Bandhan", type: "Regional" },
|
|
66
|
+
{ date: "2026-09-04", name: "Janmashtami", type: "Regional" },
|
|
67
|
+
{ date: "2026-09-14", name: "Ganesh Chaturthi", type: "State", states: ["Maharashtra", "Goa", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
68
|
+
{ date: "2026-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
69
|
+
{ date: "2026-10-20", name: "Dussehra", type: "Regional" },
|
|
70
|
+
{ date: "2026-10-21", name: "Dussehra", type: "Regional" },
|
|
71
|
+
{ date: "2026-11-08", name: "Diwali", type: "Regional" },
|
|
72
|
+
{ date: "2026-11-10", name: "Diwali", type: "Regional" },
|
|
73
|
+
{ date: "2026-11-24", name: "Guru Nanak Jayanti", type: "State", states: ["Punjab", "Haryana", "Himachal Pradesh"] },
|
|
74
|
+
{ date: "2026-12-25", name: "Christmas", type: "Regional" },
|
|
75
|
+
// 2027
|
|
76
|
+
{ date: "2027-01-14", name: "Makar Sankranti", type: "Regional", states: ["Gujarat", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
77
|
+
{ date: "2027-01-15", name: "Pongal", type: "State", states: ["Tamil Nadu"] },
|
|
78
|
+
{ date: "2027-01-26", name: "Republic Day", type: "National" },
|
|
79
|
+
{ date: "2027-03-10", name: "Holi", type: "Regional" },
|
|
80
|
+
{ date: "2027-03-26", name: "Good Friday", type: "Regional" },
|
|
81
|
+
{ date: "2027-04-14", name: "Ambedkar Jayanti", type: "Regional" },
|
|
82
|
+
{ date: "2027-04-14", name: "Vaisakhi", type: "State", states: ["Punjab", "Haryana"] },
|
|
83
|
+
{ date: "2027-03-25", name: "Ram Navami", type: "Regional" },
|
|
84
|
+
{ date: "2027-05-01", name: "Labour Day", type: "State", states: ["Maharashtra", "Karnataka", "Kerala", "Tamil Nadu"] },
|
|
85
|
+
{ date: "2027-05-27", name: "Eid ul-Fitr", type: "Regional" },
|
|
86
|
+
{ date: "2027-08-15", name: "Independence Day", type: "National" },
|
|
87
|
+
{ date: "2027-08-04", name: "Raksha Bandhan", type: "Regional" },
|
|
88
|
+
{ date: "2027-08-07", name: "Janmashtami", type: "Regional" },
|
|
89
|
+
{ date: "2027-08-15", name: "Ganesh Chaturthi", type: "State", states: ["Maharashtra", "Goa", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
90
|
+
{ date: "2027-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
91
|
+
{ date: "2027-10-21", name: "Dussehra", type: "Regional" },
|
|
92
|
+
{ date: "2027-10-28", name: "Eid ul-Adha", type: "Regional" },
|
|
93
|
+
{ date: "2027-11-08", name: "Diwali", type: "Regional" },
|
|
94
|
+
{ date: "2027-11-09", name: "Diwali", type: "Regional" },
|
|
95
|
+
{ date: "2027-11-24", name: "Guru Nanak Jayanti", type: "State", states: ["Punjab", "Haryana", "Himachal Pradesh"] },
|
|
96
|
+
{ date: "2027-12-25", name: "Christmas", type: "Regional" }
|
|
97
|
+
];
|
|
98
|
+
var STATE_HOLIDAYS = [
|
|
99
|
+
// Maharashtra
|
|
100
|
+
{ date: "2025-05-01", name: "Maharashtra Day", type: "State", states: ["Maharashtra"] },
|
|
101
|
+
{ date: "2026-05-01", name: "Maharashtra Day", type: "State", states: ["Maharashtra"] },
|
|
102
|
+
{ date: "2027-05-01", name: "Maharashtra Day", type: "State", states: ["Maharashtra"] },
|
|
103
|
+
// Karnataka
|
|
104
|
+
{ date: "2025-11-01", name: "Karnataka Rajyotsava", type: "State", states: ["Karnataka"] },
|
|
105
|
+
{ date: "2026-11-01", name: "Karnataka Rajyotsava", type: "State", states: ["Karnataka"] },
|
|
106
|
+
{ date: "2027-11-01", name: "Karnataka Rajyotsava", type: "State", states: ["Karnataka"] },
|
|
107
|
+
// Tamil Nadu
|
|
108
|
+
{ date: "2025-04-14", name: "Tamil New Year", type: "State", states: ["Tamil Nadu"] },
|
|
109
|
+
{ date: "2026-04-14", name: "Tamil New Year", type: "State", states: ["Tamil Nadu"] },
|
|
110
|
+
{ date: "2027-04-14", name: "Tamil New Year", type: "State", states: ["Tamil Nadu"] },
|
|
111
|
+
// West Bengal
|
|
112
|
+
{ date: "2025-04-15", name: "Bengali New Year", type: "State", states: ["West Bengal"] },
|
|
113
|
+
{ date: "2026-04-15", name: "Bengali New Year", type: "State", states: ["West Bengal"] },
|
|
114
|
+
{ date: "2027-04-15", name: "Bengali New Year", type: "State", states: ["West Bengal"] },
|
|
115
|
+
// Kerala
|
|
116
|
+
{ date: "2025-04-14", name: "Vishu", type: "State", states: ["Kerala"] },
|
|
117
|
+
{ date: "2026-04-14", name: "Vishu", type: "State", states: ["Kerala"] },
|
|
118
|
+
{ date: "2027-04-14", name: "Vishu", type: "State", states: ["Kerala"] },
|
|
119
|
+
// Gujarat
|
|
120
|
+
{ date: "2025-10-31", name: "Gujarati New Year", type: "State", states: ["Gujarat"] },
|
|
121
|
+
{ date: "2026-10-20", name: "Gujarati New Year", type: "State", states: ["Gujarat"] },
|
|
122
|
+
{ date: "2027-11-08", name: "Gujarati New Year", type: "State", states: ["Gujarat"] }
|
|
123
|
+
];
|
|
124
|
+
var ALL_HOLIDAYS = [
|
|
125
|
+
...NATIONAL_HOLIDAYS,
|
|
126
|
+
...RELIGIOUS_HOLIDAYS,
|
|
127
|
+
...STATE_HOLIDAYS
|
|
128
|
+
];
|
|
129
|
+
|
|
130
|
+
// src/index.ts
|
|
131
|
+
function getAllHolidays() {
|
|
132
|
+
return [...ALL_HOLIDAYS];
|
|
133
|
+
}
|
|
134
|
+
function getHolidays(options = {}) {
|
|
135
|
+
let filtered = [...ALL_HOLIDAYS];
|
|
136
|
+
if (options.year) {
|
|
137
|
+
filtered = filtered.filter((h) => h.date.startsWith(options.year.toString()));
|
|
138
|
+
}
|
|
139
|
+
if (options.month) {
|
|
140
|
+
const monthStr = options.month.toString().padStart(2, "0");
|
|
141
|
+
filtered = filtered.filter((h) => h.date.substring(5, 7) === monthStr);
|
|
142
|
+
}
|
|
143
|
+
if (options.startDate) {
|
|
144
|
+
filtered = filtered.filter((h) => h.date >= options.startDate);
|
|
145
|
+
}
|
|
146
|
+
if (options.endDate) {
|
|
147
|
+
filtered = filtered.filter((h) => h.date <= options.endDate);
|
|
148
|
+
}
|
|
149
|
+
if (options.state) {
|
|
150
|
+
filtered = filtered.filter((h) => {
|
|
151
|
+
if (h.type === "National") return true;
|
|
152
|
+
if (!h.states) return true;
|
|
153
|
+
return h.states.includes(options.state);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
filtered.sort((a, b) => a.date.localeCompare(b.date));
|
|
157
|
+
return {
|
|
158
|
+
holidays: filtered,
|
|
159
|
+
total: filtered.length,
|
|
160
|
+
query: options
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function getHolidaysByYear(year) {
|
|
164
|
+
return getHolidays({ year }).holidays;
|
|
165
|
+
}
|
|
166
|
+
function getHolidaysByMonth(year, month) {
|
|
167
|
+
return getHolidays({ year, month }).holidays;
|
|
168
|
+
}
|
|
169
|
+
function getHolidaysByState(state, year) {
|
|
170
|
+
return getHolidays({ state, year }).holidays;
|
|
171
|
+
}
|
|
172
|
+
function getHolidaysByDateRange(startDate, endDate, options) {
|
|
173
|
+
return getHolidays({ ...options, startDate, endDate }).holidays;
|
|
174
|
+
}
|
|
175
|
+
function isHoliday(date, state) {
|
|
176
|
+
const dateStr = typeof date === "string" ? date : date.toISOString().split("T")[0];
|
|
177
|
+
const holidays = getHolidays({ state }).holidays;
|
|
178
|
+
return holidays.some((h) => h.date === dateStr);
|
|
179
|
+
}
|
|
180
|
+
function getHolidayByDate(date, state) {
|
|
181
|
+
const dateStr = typeof date === "string" ? date : date.toISOString().split("T")[0];
|
|
182
|
+
const holidays = getHolidays({ state }).holidays;
|
|
183
|
+
return holidays.find((h) => h.date === dateStr) || null;
|
|
184
|
+
}
|
|
185
|
+
function getNextHoliday(fromDate, state) {
|
|
186
|
+
const dateStr = fromDate ? typeof fromDate === "string" ? fromDate : fromDate.toISOString().split("T")[0] : (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
187
|
+
const holidays = getHolidays({ state }).holidays;
|
|
188
|
+
const futureHolidays = holidays.filter((h) => h.date > dateStr);
|
|
189
|
+
if (futureHolidays.length === 0) return null;
|
|
190
|
+
return futureHolidays[0];
|
|
191
|
+
}
|
|
192
|
+
function getUpcomingHolidays(days = 30, state) {
|
|
193
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
194
|
+
const futureDate = /* @__PURE__ */ new Date();
|
|
195
|
+
futureDate.setDate(futureDate.getDate() + days);
|
|
196
|
+
const endDate = futureDate.toISOString().split("T")[0];
|
|
197
|
+
return getHolidaysByDateRange(today, endDate, { state });
|
|
198
|
+
}
|
|
199
|
+
function getHolidayCount(year, state) {
|
|
200
|
+
return getHolidays({ year, state }).total;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
exports.getAllHolidays = getAllHolidays;
|
|
204
|
+
exports.getHolidayByDate = getHolidayByDate;
|
|
205
|
+
exports.getHolidayCount = getHolidayCount;
|
|
206
|
+
exports.getHolidays = getHolidays;
|
|
207
|
+
exports.getHolidaysByDateRange = getHolidaysByDateRange;
|
|
208
|
+
exports.getHolidaysByMonth = getHolidaysByMonth;
|
|
209
|
+
exports.getHolidaysByState = getHolidaysByState;
|
|
210
|
+
exports.getHolidaysByYear = getHolidaysByYear;
|
|
211
|
+
exports.getNextHoliday = getNextHoliday;
|
|
212
|
+
exports.getUpcomingHolidays = getUpcomingHolidays;
|
|
213
|
+
exports.isHoliday = isHoliday;
|
|
214
|
+
//# sourceMappingURL=index.js.map
|
|
215
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/holidays.ts","../src/index.ts"],"names":[],"mappings":";;;AASA,IAAM,iBAAA,GAA+B;AAAA;AAAA,EAEnC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,cAAA,EAAgB,MAAM,UAAA,EAAW;AAAA,EAC7D,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,cAAA,EAAgB,MAAM,UAAA,EAAW;AAAA,EAC7D,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,cAAA,EAAgB,MAAM,UAAA,EAAW;AAAA;AAAA,EAG7D,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,kBAAA,EAAoB,MAAM,UAAA,EAAW;AAAA,EACjE,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,kBAAA,EAAoB,MAAM,UAAA,EAAW;AAAA,EACjE,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,kBAAA,EAAoB,MAAM,UAAA,EAAW;AAAA;AAAA,EAGjE,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,gBAAA,EAAkB,MAAM,UAAA,EAAW;AAAA,EAC/D,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,gBAAA,EAAkB,MAAM,UAAA,EAAW;AAAA,EAC/D,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,gBAAA,EAAkB,MAAM,UAAA;AACtD,CAAA;AAGA,IAAM,kBAAA,GAAgC;AAAA;AAAA,EAEpC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,iBAAA,EAAmB,IAAA,EAAM,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,qBAAY,IAAA,EAAK,EAAE,aAAY,CAAE,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA;AACnD,EAAA,MAAM,UAAA,uBAAiB,IAAA,EAAK;AAC5B,EAAA,UAAA,CAAW,OAAA,CAAQ,UAAA,CAAW,OAAA,EAAQ,GAAI,IAAI,CAAA;AAC9C,EAAA,MAAM,UAAU,UAAA,CAAW,WAAA,GAAc,KAAA,CAAM,GAAG,EAAE,CAAC,CAAA;AAErD,EAAA,OAAO,sBAAA,CAAuB,KAAA,EAAO,OAAA,EAAS,EAAE,OAAO,CAAA;AACzD;AAOO,SAAS,eAAA,CACd,MACA,KAAA,EACQ;AACR,EAAA,OAAO,WAAA,CAAY,EAAE,IAAA,EAAM,KAAA,EAAO,CAAA,CAAE,KAAA;AACtC","file":"index.js","sourcesContent":["import { Holiday, IndianState } from './types';\n\n/**\n * Indian Banking Holidays Database\n * This includes national holidays, state-specific holidays, and regional holidays\n * Dates are stored in ISO format (YYYY-MM-DD)\n */\n\n// National holidays that apply to all states\nconst NATIONAL_HOLIDAYS: Holiday[] = [\n // Republic Day\n { date: '2025-01-26', name: 'Republic Day', type: 'National' },\n { date: '2026-01-26', name: 'Republic Day', type: 'National' },\n { date: '2027-01-26', name: 'Republic Day', type: 'National' },\n \n // Independence Day\n { date: '2025-08-15', name: 'Independence Day', type: 'National' },\n { date: '2026-08-15', name: 'Independence Day', type: 'National' },\n { date: '2027-08-15', name: 'Independence Day', type: 'National' },\n \n // Gandhi Jayanti\n { date: '2025-10-02', name: 'Gandhi Jayanti', type: 'National' },\n { date: '2026-10-02', name: 'Gandhi Jayanti', type: 'National' },\n { date: '2027-10-02', name: 'Gandhi Jayanti', type: 'National' },\n];\n\n// Religious and cultural holidays (varies by state)\nconst RELIGIOUS_HOLIDAYS: Holiday[] = [\n // 2025\n { date: '2025-01-14', name: 'Makar Sankranti', type: 'Regional', states: ['Gujarat', 'Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2025-01-15', name: 'Pongal', type: 'State', states: ['Tamil Nadu'] },\n { date: '2025-01-26', name: 'Republic Day', type: 'National' },\n { date: '2025-03-08', name: 'Holi', type: 'Regional' },\n { date: '2025-03-29', name: 'Good Friday', type: 'Regional' },\n { date: '2025-04-14', name: 'Ambedkar Jayanti', type: 'Regional' },\n { date: '2025-04-14', name: 'Vaisakhi', type: 'State', states: ['Punjab', 'Haryana'] },\n { date: '2025-04-17', name: 'Ram Navami', type: 'Regional' },\n { date: '2025-05-01', name: 'Labour Day', type: 'State', states: ['Maharashtra', 'Karnataka', 'Kerala', 'Tamil Nadu'] },\n { date: '2025-06-17', name: 'Eid ul-Fitr', type: 'Regional' },\n { date: '2025-08-15', name: 'Independence Day', type: 'National' },\n { date: '2025-08-26', name: 'Raksha Bandhan', type: 'Regional' },\n { date: '2025-08-29', name: 'Janmashtami', type: 'Regional' },\n { date: '2025-09-07', name: 'Ganesh Chaturthi', type: 'State', states: ['Maharashtra', 'Goa', 'Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2025-10-02', name: 'Gandhi Jayanti', type: 'National' },\n { date: '2025-10-12', name: 'Dussehra', type: 'Regional' },\n { date: '2025-10-20', name: 'Eid ul-Adha', type: 'Regional' },\n { date: '2025-10-31', name: 'Diwali', type: 'Regional' },\n { date: '2025-11-01', name: 'Diwali', type: 'Regional' },\n { date: '2025-11-15', name: 'Guru Nanak Jayanti', type: 'State', states: ['Punjab', 'Haryana', 'Himachal Pradesh'] },\n { date: '2025-12-25', name: 'Christmas', type: 'Regional' },\n \n // 2026 - Updated based on HDFC Bank holiday list\n { date: '2026-01-14', name: 'Makar Sankranti', type: 'Regional', states: ['Gujarat', 'Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2026-01-15', name: 'Makar Sankranti', type: 'Regional', states: ['Andhra Pradesh', 'Karnataka'] },\n { date: '2026-01-15', name: 'Pongal', type: 'State', states: ['Tamil Nadu'] },\n { date: '2026-01-26', name: 'Republic Day', type: 'National' },\n { date: '2026-02-15', name: 'Mahashivratri', type: 'Regional' },\n { date: '2026-03-03', name: 'Holi', type: 'Regional' },\n { date: '2026-03-04', name: 'Holi', type: 'Regional' },\n { date: '2026-03-19', name: 'Ugadi Festival', type: 'State', states: ['Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2026-03-20', name: 'Eid ul-Fitr', type: 'Regional' },\n { date: '2026-03-21', name: 'Eid ul-Fitr', type: 'Regional' },\n { date: '2026-03-26', name: 'Ram Navami', type: 'Regional' },\n { date: '2026-03-27', name: 'Ram Navami', type: 'Regional' },\n { date: '2026-03-31', name: 'Mahavir Jayanti', type: 'Regional' },\n { date: '2026-04-03', name: 'Good Friday', type: 'Regional' },\n { date: '2026-04-14', name: 'Ambedkar Jayanti', type: 'Regional' },\n { date: '2026-04-14', name: 'Vaisakhi', type: 'State', states: ['Punjab', 'Haryana'] },\n { date: '2026-05-01', name: 'Labour Day', type: 'State', states: ['Maharashtra', 'Karnataka', 'Kerala', 'Tamil Nadu'] },\n { date: '2026-05-01', name: 'Buddha Poornima', type: 'Regional' },\n { date: '2026-05-27', name: 'Eid ul-Adha', type: 'Regional' },\n { date: '2026-05-28', name: 'Eid ul-Adha', type: 'Regional' },\n { date: '2026-06-26', name: 'Moharram', type: 'Regional' },\n { date: '2026-08-15', name: 'Independence Day', type: 'National' },\n { date: '2026-08-26', name: 'Id A Milad', type: 'Regional' },\n { date: '2026-08-28', name: 'Raksha Bandhan', type: 'Regional' },\n { date: '2026-09-04', name: 'Janmashtami', type: 'Regional' },\n { date: '2026-09-14', name: 'Ganesh Chaturthi', type: 'State', states: ['Maharashtra', 'Goa', 'Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2026-10-02', name: 'Gandhi Jayanti', type: 'National' },\n { date: '2026-10-20', name: 'Dussehra', type: 'Regional' },\n { date: '2026-10-21', name: 'Dussehra', type: 'Regional' },\n { date: '2026-11-08', name: 'Diwali', type: 'Regional' },\n { date: '2026-11-10', name: 'Diwali', type: 'Regional' },\n { date: '2026-11-24', name: 'Guru Nanak Jayanti', type: 'State', states: ['Punjab', 'Haryana', 'Himachal Pradesh'] },\n { date: '2026-12-25', name: 'Christmas', type: 'Regional' },\n \n // 2027\n { date: '2027-01-14', name: 'Makar Sankranti', type: 'Regional', states: ['Gujarat', 'Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2027-01-15', name: 'Pongal', type: 'State', states: ['Tamil Nadu'] },\n { date: '2027-01-26', name: 'Republic Day', type: 'National' },\n { date: '2027-03-10', name: 'Holi', type: 'Regional' },\n { date: '2027-03-26', name: 'Good Friday', type: 'Regional' },\n { date: '2027-04-14', name: 'Ambedkar Jayanti', type: 'Regional' },\n { date: '2027-04-14', name: 'Vaisakhi', type: 'State', states: ['Punjab', 'Haryana'] },\n { date: '2027-03-25', name: 'Ram Navami', type: 'Regional' },\n { date: '2027-05-01', name: 'Labour Day', type: 'State', states: ['Maharashtra', 'Karnataka', 'Kerala', 'Tamil Nadu'] },\n { date: '2027-05-27', name: 'Eid ul-Fitr', type: 'Regional' },\n { date: '2027-08-15', name: 'Independence Day', type: 'National' },\n { date: '2027-08-04', name: 'Raksha Bandhan', type: 'Regional' },\n { date: '2027-08-07', name: 'Janmashtami', type: 'Regional' },\n { date: '2027-08-15', name: 'Ganesh Chaturthi', type: 'State', states: ['Maharashtra', 'Goa', 'Karnataka', 'Andhra Pradesh', 'Telangana'] },\n { date: '2027-10-02', name: 'Gandhi Jayanti', type: 'National' },\n { date: '2027-10-21', name: 'Dussehra', type: 'Regional' },\n { date: '2027-10-28', name: 'Eid ul-Adha', type: 'Regional' },\n { date: '2027-11-08', name: 'Diwali', type: 'Regional' },\n { date: '2027-11-09', name: 'Diwali', type: 'Regional' },\n { date: '2027-11-24', name: 'Guru Nanak Jayanti', type: 'State', states: ['Punjab', 'Haryana', 'Himachal Pradesh'] },\n { date: '2027-12-25', name: 'Christmas', type: 'Regional' },\n];\n\n// State-specific holidays\nconst STATE_HOLIDAYS: Holiday[] = [\n // Maharashtra\n { date: '2025-05-01', name: 'Maharashtra Day', type: 'State', states: ['Maharashtra'] },\n { date: '2026-05-01', name: 'Maharashtra Day', type: 'State', states: ['Maharashtra'] },\n { date: '2027-05-01', name: 'Maharashtra Day', type: 'State', states: ['Maharashtra'] },\n \n // Karnataka\n { date: '2025-11-01', name: 'Karnataka Rajyotsava', type: 'State', states: ['Karnataka'] },\n { date: '2026-11-01', name: 'Karnataka Rajyotsava', type: 'State', states: ['Karnataka'] },\n { date: '2027-11-01', name: 'Karnataka Rajyotsava', type: 'State', states: ['Karnataka'] },\n \n // Tamil Nadu\n { date: '2025-04-14', name: 'Tamil New Year', type: 'State', states: ['Tamil Nadu'] },\n { date: '2026-04-14', name: 'Tamil New Year', type: 'State', states: ['Tamil Nadu'] },\n { date: '2027-04-14', name: 'Tamil New Year', type: 'State', states: ['Tamil Nadu'] },\n \n // West Bengal\n { date: '2025-04-15', name: 'Bengali New Year', type: 'State', states: ['West Bengal'] },\n { date: '2026-04-15', name: 'Bengali New Year', type: 'State', states: ['West Bengal'] },\n { date: '2027-04-15', name: 'Bengali New Year', type: 'State', states: ['West Bengal'] },\n \n // Kerala\n { date: '2025-04-14', name: 'Vishu', type: 'State', states: ['Kerala'] },\n { date: '2026-04-14', name: 'Vishu', type: 'State', states: ['Kerala'] },\n { date: '2027-04-14', name: 'Vishu', type: 'State', states: ['Kerala'] },\n \n // Gujarat\n { date: '2025-10-31', name: 'Gujarati New Year', type: 'State', states: ['Gujarat'] },\n { date: '2026-10-20', name: 'Gujarati New Year', type: 'State', states: ['Gujarat'] },\n { date: '2027-11-08', name: 'Gujarati New Year', type: 'State', states: ['Gujarat'] },\n];\n\n// Combine all holidays\nexport const ALL_HOLIDAYS: Holiday[] = [\n ...NATIONAL_HOLIDAYS,\n ...RELIGIOUS_HOLIDAYS,\n ...STATE_HOLIDAYS,\n];\n","import { ALL_HOLIDAYS } from './holidays';\nimport {\n Holiday,\n HolidayQueryOptions,\n HolidayResult,\n IndianState,\n} from './types';\n\n/**\n * Get all banking holidays\n */\nexport function getAllHolidays(): Holiday[] {\n return [...ALL_HOLIDAYS];\n}\n\n/**\n * Query holidays based on various filters\n */\nexport function getHolidays(options: HolidayQueryOptions = {}): HolidayResult {\n let filtered = [...ALL_HOLIDAYS];\n\n // Filter by year\n if (options.year) {\n filtered = filtered.filter((h) => h.date.startsWith(options.year!.toString()));\n }\n\n // Filter by month\n if (options.month) {\n const monthStr = options.month.toString().padStart(2, '0');\n filtered = filtered.filter((h) => h.date.substring(5, 7) === monthStr);\n }\n\n // Filter by date range\n if (options.startDate) {\n filtered = filtered.filter((h) => h.date >= options.startDate!);\n }\n if (options.endDate) {\n filtered = filtered.filter((h) => h.date <= options.endDate!);\n }\n\n // Filter by state\n if (options.state) {\n filtered = filtered.filter((h) => {\n // National holidays apply to all states\n if (h.type === 'National') return true;\n // If no states specified, it applies to all states\n if (!h.states) return true;\n // Check if the state is in the list\n return h.states.includes(options.state!);\n });\n }\n\n // Sort by date\n filtered.sort((a, b) => a.date.localeCompare(b.date));\n\n return {\n holidays: filtered,\n total: filtered.length,\n query: options,\n };\n}\n\n/**\n * Get holidays for a specific year\n */\nexport function getHolidaysByYear(year: number): Holiday[] {\n return getHolidays({ year }).holidays;\n}\n\n/**\n * Get holidays for a specific month\n */\nexport function getHolidaysByMonth(year: number, month: number): Holiday[] {\n return getHolidays({ year, month }).holidays;\n}\n\n/**\n * Get holidays for a specific state\n */\nexport function getHolidaysByState(\n state: IndianState,\n year?: number\n): Holiday[] {\n return getHolidays({ state, year }).holidays;\n}\n\n/**\n * Get holidays for a date range\n */\nexport function getHolidaysByDateRange(\n startDate: string,\n endDate: string,\n options?: Omit<HolidayQueryOptions, 'startDate' | 'endDate'>\n): Holiday[] {\n return getHolidays({ ...options, startDate, endDate }).holidays;\n}\n\n/**\n * Check if a specific date is a banking holiday\n * @param date - Date to check (string in YYYY-MM-DD format or Date object)\n * @param state - Optional state filter\n */\nexport function isHoliday(\n date: string | Date,\n state?: IndianState\n): boolean {\n const dateStr =\n typeof date === 'string' ? date : date.toISOString().split('T')[0];\n const holidays = getHolidays({ state }).holidays;\n return holidays.some((h) => h.date === dateStr);\n}\n\n/**\n * Get holiday information for a specific date\n * @param date - Date to check (string in YYYY-MM-DD format or Date object)\n * @param state - Optional state filter\n */\nexport function getHolidayByDate(\n date: string | Date,\n state?: IndianState\n): Holiday | null {\n const dateStr =\n typeof date === 'string' ? date : date.toISOString().split('T')[0];\n const holidays = getHolidays({ state }).holidays;\n return holidays.find((h) => h.date === dateStr) || null;\n}\n\n/**\n * Get the next banking holiday from a given date\n * @param fromDate - Starting date (defaults to today)\n * @param state - Optional state filter\n */\nexport function getNextHoliday(\n fromDate?: string | Date,\n state?: IndianState\n): Holiday | null {\n const dateStr = fromDate\n ? typeof fromDate === 'string'\n ? fromDate\n : fromDate.toISOString().split('T')[0]\n : new Date().toISOString().split('T')[0];\n\n const holidays = getHolidays({ state }).holidays;\n const futureHolidays = holidays.filter((h) => h.date > dateStr);\n\n if (futureHolidays.length === 0) return null;\n\n return futureHolidays[0];\n}\n\n/**\n * Get upcoming holidays within a specified number of days\n * @param days - Number of days to look ahead (default: 30)\n * @param state - Optional state filter\n */\nexport function getUpcomingHolidays(\n days: number = 30,\n state?: IndianState\n): Holiday[] {\n const today = new Date().toISOString().split('T')[0];\n const futureDate = new Date();\n futureDate.setDate(futureDate.getDate() + days);\n const endDate = futureDate.toISOString().split('T')[0];\n\n return getHolidaysByDateRange(today, endDate, { state });\n}\n\n/**\n * Get holidays count for a year\n * @param year - Year to get count for\n * @param state - Optional state filter\n */\nexport function getHolidayCount(\n year: number,\n state?: IndianState\n): number {\n return getHolidays({ year, state }).total;\n}\n\n// Export types\nexport type {\n Holiday,\n HolidayQueryOptions,\n HolidayResult,\n IndianState,\n HolidayType,\n} from './types';\n"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// src/holidays.ts
|
|
2
|
+
var NATIONAL_HOLIDAYS = [
|
|
3
|
+
// Republic Day
|
|
4
|
+
{ date: "2025-01-26", name: "Republic Day", type: "National" },
|
|
5
|
+
{ date: "2026-01-26", name: "Republic Day", type: "National" },
|
|
6
|
+
{ date: "2027-01-26", name: "Republic Day", type: "National" },
|
|
7
|
+
// Independence Day
|
|
8
|
+
{ date: "2025-08-15", name: "Independence Day", type: "National" },
|
|
9
|
+
{ date: "2026-08-15", name: "Independence Day", type: "National" },
|
|
10
|
+
{ date: "2027-08-15", name: "Independence Day", type: "National" },
|
|
11
|
+
// Gandhi Jayanti
|
|
12
|
+
{ date: "2025-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
13
|
+
{ date: "2026-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
14
|
+
{ date: "2027-10-02", name: "Gandhi Jayanti", type: "National" }
|
|
15
|
+
];
|
|
16
|
+
var RELIGIOUS_HOLIDAYS = [
|
|
17
|
+
// 2025
|
|
18
|
+
{ date: "2025-01-14", name: "Makar Sankranti", type: "Regional", states: ["Gujarat", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
19
|
+
{ date: "2025-01-15", name: "Pongal", type: "State", states: ["Tamil Nadu"] },
|
|
20
|
+
{ date: "2025-01-26", name: "Republic Day", type: "National" },
|
|
21
|
+
{ date: "2025-03-08", name: "Holi", type: "Regional" },
|
|
22
|
+
{ date: "2025-03-29", name: "Good Friday", type: "Regional" },
|
|
23
|
+
{ date: "2025-04-14", name: "Ambedkar Jayanti", type: "Regional" },
|
|
24
|
+
{ date: "2025-04-14", name: "Vaisakhi", type: "State", states: ["Punjab", "Haryana"] },
|
|
25
|
+
{ date: "2025-04-17", name: "Ram Navami", type: "Regional" },
|
|
26
|
+
{ date: "2025-05-01", name: "Labour Day", type: "State", states: ["Maharashtra", "Karnataka", "Kerala", "Tamil Nadu"] },
|
|
27
|
+
{ date: "2025-06-17", name: "Eid ul-Fitr", type: "Regional" },
|
|
28
|
+
{ date: "2025-08-15", name: "Independence Day", type: "National" },
|
|
29
|
+
{ date: "2025-08-26", name: "Raksha Bandhan", type: "Regional" },
|
|
30
|
+
{ date: "2025-08-29", name: "Janmashtami", type: "Regional" },
|
|
31
|
+
{ date: "2025-09-07", name: "Ganesh Chaturthi", type: "State", states: ["Maharashtra", "Goa", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
32
|
+
{ date: "2025-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
33
|
+
{ date: "2025-10-12", name: "Dussehra", type: "Regional" },
|
|
34
|
+
{ date: "2025-10-20", name: "Eid ul-Adha", type: "Regional" },
|
|
35
|
+
{ date: "2025-10-31", name: "Diwali", type: "Regional" },
|
|
36
|
+
{ date: "2025-11-01", name: "Diwali", type: "Regional" },
|
|
37
|
+
{ date: "2025-11-15", name: "Guru Nanak Jayanti", type: "State", states: ["Punjab", "Haryana", "Himachal Pradesh"] },
|
|
38
|
+
{ date: "2025-12-25", name: "Christmas", type: "Regional" },
|
|
39
|
+
// 2026 - Updated based on HDFC Bank holiday list
|
|
40
|
+
{ date: "2026-01-14", name: "Makar Sankranti", type: "Regional", states: ["Gujarat", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
41
|
+
{ date: "2026-01-15", name: "Makar Sankranti", type: "Regional", states: ["Andhra Pradesh", "Karnataka"] },
|
|
42
|
+
{ date: "2026-01-15", name: "Pongal", type: "State", states: ["Tamil Nadu"] },
|
|
43
|
+
{ date: "2026-01-26", name: "Republic Day", type: "National" },
|
|
44
|
+
{ date: "2026-02-15", name: "Mahashivratri", type: "Regional" },
|
|
45
|
+
{ date: "2026-03-03", name: "Holi", type: "Regional" },
|
|
46
|
+
{ date: "2026-03-04", name: "Holi", type: "Regional" },
|
|
47
|
+
{ date: "2026-03-19", name: "Ugadi Festival", type: "State", states: ["Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
48
|
+
{ date: "2026-03-20", name: "Eid ul-Fitr", type: "Regional" },
|
|
49
|
+
{ date: "2026-03-21", name: "Eid ul-Fitr", type: "Regional" },
|
|
50
|
+
{ date: "2026-03-26", name: "Ram Navami", type: "Regional" },
|
|
51
|
+
{ date: "2026-03-27", name: "Ram Navami", type: "Regional" },
|
|
52
|
+
{ date: "2026-03-31", name: "Mahavir Jayanti", type: "Regional" },
|
|
53
|
+
{ date: "2026-04-03", name: "Good Friday", type: "Regional" },
|
|
54
|
+
{ date: "2026-04-14", name: "Ambedkar Jayanti", type: "Regional" },
|
|
55
|
+
{ date: "2026-04-14", name: "Vaisakhi", type: "State", states: ["Punjab", "Haryana"] },
|
|
56
|
+
{ date: "2026-05-01", name: "Labour Day", type: "State", states: ["Maharashtra", "Karnataka", "Kerala", "Tamil Nadu"] },
|
|
57
|
+
{ date: "2026-05-01", name: "Buddha Poornima", type: "Regional" },
|
|
58
|
+
{ date: "2026-05-27", name: "Eid ul-Adha", type: "Regional" },
|
|
59
|
+
{ date: "2026-05-28", name: "Eid ul-Adha", type: "Regional" },
|
|
60
|
+
{ date: "2026-06-26", name: "Moharram", type: "Regional" },
|
|
61
|
+
{ date: "2026-08-15", name: "Independence Day", type: "National" },
|
|
62
|
+
{ date: "2026-08-26", name: "Id A Milad", type: "Regional" },
|
|
63
|
+
{ date: "2026-08-28", name: "Raksha Bandhan", type: "Regional" },
|
|
64
|
+
{ date: "2026-09-04", name: "Janmashtami", type: "Regional" },
|
|
65
|
+
{ date: "2026-09-14", name: "Ganesh Chaturthi", type: "State", states: ["Maharashtra", "Goa", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
66
|
+
{ date: "2026-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
67
|
+
{ date: "2026-10-20", name: "Dussehra", type: "Regional" },
|
|
68
|
+
{ date: "2026-10-21", name: "Dussehra", type: "Regional" },
|
|
69
|
+
{ date: "2026-11-08", name: "Diwali", type: "Regional" },
|
|
70
|
+
{ date: "2026-11-10", name: "Diwali", type: "Regional" },
|
|
71
|
+
{ date: "2026-11-24", name: "Guru Nanak Jayanti", type: "State", states: ["Punjab", "Haryana", "Himachal Pradesh"] },
|
|
72
|
+
{ date: "2026-12-25", name: "Christmas", type: "Regional" },
|
|
73
|
+
// 2027
|
|
74
|
+
{ date: "2027-01-14", name: "Makar Sankranti", type: "Regional", states: ["Gujarat", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
75
|
+
{ date: "2027-01-15", name: "Pongal", type: "State", states: ["Tamil Nadu"] },
|
|
76
|
+
{ date: "2027-01-26", name: "Republic Day", type: "National" },
|
|
77
|
+
{ date: "2027-03-10", name: "Holi", type: "Regional" },
|
|
78
|
+
{ date: "2027-03-26", name: "Good Friday", type: "Regional" },
|
|
79
|
+
{ date: "2027-04-14", name: "Ambedkar Jayanti", type: "Regional" },
|
|
80
|
+
{ date: "2027-04-14", name: "Vaisakhi", type: "State", states: ["Punjab", "Haryana"] },
|
|
81
|
+
{ date: "2027-03-25", name: "Ram Navami", type: "Regional" },
|
|
82
|
+
{ date: "2027-05-01", name: "Labour Day", type: "State", states: ["Maharashtra", "Karnataka", "Kerala", "Tamil Nadu"] },
|
|
83
|
+
{ date: "2027-05-27", name: "Eid ul-Fitr", type: "Regional" },
|
|
84
|
+
{ date: "2027-08-15", name: "Independence Day", type: "National" },
|
|
85
|
+
{ date: "2027-08-04", name: "Raksha Bandhan", type: "Regional" },
|
|
86
|
+
{ date: "2027-08-07", name: "Janmashtami", type: "Regional" },
|
|
87
|
+
{ date: "2027-08-15", name: "Ganesh Chaturthi", type: "State", states: ["Maharashtra", "Goa", "Karnataka", "Andhra Pradesh", "Telangana"] },
|
|
88
|
+
{ date: "2027-10-02", name: "Gandhi Jayanti", type: "National" },
|
|
89
|
+
{ date: "2027-10-21", name: "Dussehra", type: "Regional" },
|
|
90
|
+
{ date: "2027-10-28", name: "Eid ul-Adha", type: "Regional" },
|
|
91
|
+
{ date: "2027-11-08", name: "Diwali", type: "Regional" },
|
|
92
|
+
{ date: "2027-11-09", name: "Diwali", type: "Regional" },
|
|
93
|
+
{ date: "2027-11-24", name: "Guru Nanak Jayanti", type: "State", states: ["Punjab", "Haryana", "Himachal Pradesh"] },
|
|
94
|
+
{ date: "2027-12-25", name: "Christmas", type: "Regional" }
|
|
95
|
+
];
|
|
96
|
+
var STATE_HOLIDAYS = [
|
|
97
|
+
// Maharashtra
|
|
98
|
+
{ date: "2025-05-01", name: "Maharashtra Day", type: "State", states: ["Maharashtra"] },
|
|
99
|
+
{ date: "2026-05-01", name: "Maharashtra Day", type: "State", states: ["Maharashtra"] },
|
|
100
|
+
{ date: "2027-05-01", name: "Maharashtra Day", type: "State", states: ["Maharashtra"] },
|
|
101
|
+
// Karnataka
|
|
102
|
+
{ date: "2025-11-01", name: "Karnataka Rajyotsava", type: "State", states: ["Karnataka"] },
|
|
103
|
+
{ date: "2026-11-01", name: "Karnataka Rajyotsava", type: "State", states: ["Karnataka"] },
|
|
104
|
+
{ date: "2027-11-01", name: "Karnataka Rajyotsava", type: "State", states: ["Karnataka"] },
|
|
105
|
+
// Tamil Nadu
|
|
106
|
+
{ date: "2025-04-14", name: "Tamil New Year", type: "State", states: ["Tamil Nadu"] },
|
|
107
|
+
{ date: "2026-04-14", name: "Tamil New Year", type: "State", states: ["Tamil Nadu"] },
|
|
108
|
+
{ date: "2027-04-14", name: "Tamil New Year", type: "State", states: ["Tamil Nadu"] },
|
|
109
|
+
// West Bengal
|
|
110
|
+
{ date: "2025-04-15", name: "Bengali New Year", type: "State", states: ["West Bengal"] },
|
|
111
|
+
{ date: "2026-04-15", name: "Bengali New Year", type: "State", states: ["West Bengal"] },
|
|
112
|
+
{ date: "2027-04-15", name: "Bengali New Year", type: "State", states: ["West Bengal"] },
|
|
113
|
+
// Kerala
|
|
114
|
+
{ date: "2025-04-14", name: "Vishu", type: "State", states: ["Kerala"] },
|
|
115
|
+
{ date: "2026-04-14", name: "Vishu", type: "State", states: ["Kerala"] },
|
|
116
|
+
{ date: "2027-04-14", name: "Vishu", type: "State", states: ["Kerala"] },
|
|
117
|
+
// Gujarat
|
|
118
|
+
{ date: "2025-10-31", name: "Gujarati New Year", type: "State", states: ["Gujarat"] },
|
|
119
|
+
{ date: "2026-10-20", name: "Gujarati New Year", type: "State", states: ["Gujarat"] },
|
|
120
|
+
{ date: "2027-11-08", name: "Gujarati New Year", type: "State", states: ["Gujarat"] }
|
|
121
|
+
];
|
|
122
|
+
var ALL_HOLIDAYS = [
|
|
123
|
+
...NATIONAL_HOLIDAYS,
|
|
124
|
+
...RELIGIOUS_HOLIDAYS,
|
|
125
|
+
...STATE_HOLIDAYS
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
// src/index.ts
|
|
129
|
+
function getAllHolidays() {
|
|
130
|
+
return [...ALL_HOLIDAYS];
|
|
131
|
+
}
|
|
132
|
+
function getHolidays(options = {}) {
|
|
133
|
+
let filtered = [...ALL_HOLIDAYS];
|
|
134
|
+
if (options.year) {
|
|
135
|
+
filtered = filtered.filter((h) => h.date.startsWith(options.year.toString()));
|
|
136
|
+
}
|
|
137
|
+
if (options.month) {
|
|
138
|
+
const monthStr = options.month.toString().padStart(2, "0");
|
|
139
|
+
filtered = filtered.filter((h) => h.date.substring(5, 7) === monthStr);
|
|
140
|
+
}
|
|
141
|
+
if (options.startDate) {
|
|
142
|
+
filtered = filtered.filter((h) => h.date >= options.startDate);
|
|
143
|
+
}
|
|
144
|
+
if (options.endDate) {
|
|
145
|
+
filtered = filtered.filter((h) => h.date <= options.endDate);
|
|
146
|
+
}
|
|
147
|
+
if (options.state) {
|
|
148
|
+
filtered = filtered.filter((h) => {
|
|
149
|
+
if (h.type === "National") return true;
|
|
150
|
+
if (!h.states) return true;
|
|
151
|
+
return h.states.includes(options.state);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
filtered.sort((a, b) => a.date.localeCompare(b.date));
|
|
155
|
+
return {
|
|
156
|
+
holidays: filtered,
|
|
157
|
+
total: filtered.length,
|
|
158
|
+
query: options
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function getHolidaysByYear(year) {
|
|
162
|
+
return getHolidays({ year }).holidays;
|
|
163
|
+
}
|
|
164
|
+
function getHolidaysByMonth(year, month) {
|
|
165
|
+
return getHolidays({ year, month }).holidays;
|
|
166
|
+
}
|
|
167
|
+
function getHolidaysByState(state, year) {
|
|
168
|
+
return getHolidays({ state, year }).holidays;
|
|
169
|
+
}
|
|
170
|
+
function getHolidaysByDateRange(startDate, endDate, options) {
|
|
171
|
+
return getHolidays({ ...options, startDate, endDate }).holidays;
|
|
172
|
+
}
|
|
173
|
+
function isHoliday(date, state) {
|
|
174
|
+
const dateStr = typeof date === "string" ? date : date.toISOString().split("T")[0];
|
|
175
|
+
const holidays = getHolidays({ state }).holidays;
|
|
176
|
+
return holidays.some((h) => h.date === dateStr);
|
|
177
|
+
}
|
|
178
|
+
function getHolidayByDate(date, state) {
|
|
179
|
+
const dateStr = typeof date === "string" ? date : date.toISOString().split("T")[0];
|
|
180
|
+
const holidays = getHolidays({ state }).holidays;
|
|
181
|
+
return holidays.find((h) => h.date === dateStr) || null;
|
|
182
|
+
}
|
|
183
|
+
function getNextHoliday(fromDate, state) {
|
|
184
|
+
const dateStr = fromDate ? typeof fromDate === "string" ? fromDate : fromDate.toISOString().split("T")[0] : (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
185
|
+
const holidays = getHolidays({ state }).holidays;
|
|
186
|
+
const futureHolidays = holidays.filter((h) => h.date > dateStr);
|
|
187
|
+
if (futureHolidays.length === 0) return null;
|
|
188
|
+
return futureHolidays[0];
|
|
189
|
+
}
|
|
190
|
+
function getUpcomingHolidays(days = 30, state) {
|
|
191
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
192
|
+
const futureDate = /* @__PURE__ */ new Date();
|
|
193
|
+
futureDate.setDate(futureDate.getDate() + days);
|
|
194
|
+
const endDate = futureDate.toISOString().split("T")[0];
|
|
195
|
+
return getHolidaysByDateRange(today, endDate, { state });
|
|
196
|
+
}
|
|
197
|
+
function getHolidayCount(year, state) {
|
|
198
|
+
return getHolidays({ year, state }).total;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export { getAllHolidays, getHolidayByDate, getHolidayCount, getHolidays, getHolidaysByDateRange, getHolidaysByMonth, getHolidaysByState, getHolidaysByYear, getNextHoliday, getUpcomingHolidays, isHoliday };
|
|
202
|
+
//# sourceMappingURL=index.mjs.map
|
|
203
|
+
//# sourceMappingURL=index.mjs.map
|