-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalendar_2025.html
363 lines (326 loc) · 12.1 KB
/
Calendar_2025.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Calendar 2025</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f2f5f9;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.calendar {
background-color: #ffffff;
padding: 20px;
border-radius: 10px;
/* border: double;
border-width: 5px;
border-color: #014b2c; */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 90%;
max-width: 700px;
}
h1 {
text-align: center;
font-size: auto;
color: white;
margin-bottom: 20px;
background-color: #403465;
padding: 10px;
background-image: linear-gradient(blue 1%, #403465);
}
#calendar-container {
display: grid;
grid-template-columns: repeat(1, 1fr);
gap: 20px;
}
.month {
padding: 10px;
box-sizing: border-box;
background: #ffffff;
border: solid;
border-width: 3px;
border-color: #812f2f;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.month h3 {
text-align: center;
color: #444;
font-size: 24px;
background: #403465;
padding: 10px;
border-radius: 5px;
color: #fff;
}
.week-days {
display: grid;
grid-template-columns: repeat(7, 1fr);
text-align: center;
font-weight: bold;
background-color: #e0e0e0;
padding: 5px 0;
border-radius: 5px;
font-size: 14px;
}
.days {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 8px;
padding-top: 10px;
}
.day {
padding: 10px;
text-align: center;
background-color: #f8f9fa;
border-radius: 5px;
font-size: 16px;
font-weight: bold;
color: #444;
position: relative;
transition: 0.3s ease;
border: solid;
border-width: 1px;
border-color: #555;
}
.day:hover {
background-color: #ddd;
cursor:pointer;
}
.holiday {
background-color: #fd0404;
color: white;
}
.bank-holiday {
background-color: #0b779a;
color: white;
}
.festival {
background-color: #ff8c00;
color: white;
}
.birthday {
background-color: #774bb4;
color: white;
}
.day::after {
content: attr(title);
display: block;
font-size: 10px;
color: #ffffff;
text-align: center;
margin-top: 5px;
}
.gyan{
position: fixed;
bottom: 12px;
color: #444;
text-align: center;
}
a{text-decoration: none;}
</style>
</head>
<body>
<div class="calendar">
<h1 id="gotop">Calendar 2025 <br> <sub>Public & Bank Holidays & Festivals</sub></h1>
<div id="calendar-container"></div>
</div>
<div class="gyan"><h5><a href="#gotop">By Gyanchand Maurya</a></h5></div>
<!--------------------------FUNCTION CODE START---------------->
<script>
const holidays = {
"01-01": "New Year's Day",
"05-01": " ",
"12-01": " ",
"19-01": " ",
"26-01": "Republic Day",
"02-02": " ",
"09-02": " ",
"16-02": " ",
"23-02": " ",
"02-03": " ",
"09-03": " ",
"16-03": " ",
"18-03": "Holi",
"23-03": "Shaheed Diwas",
"30-03": "Ugadi Padwa",
"31-03": "Eid al-Fitr",
"06-04": "Rama Navami",
"13-04": " ",
"20-04": "Easter Sunday",
"27-04": " ",
"14-04": "Ambedkar Jayanti",
"18-04": "Good Friday",
"01-05": "Labour Day",
"04-05": "World Laughter Day",
"11-05": "Mother's Day",
"12-05": "Buddha Purnima",
"18-05": " ",
"25-05": " ",
"01-06": " ",
"08-06": " ",
"15-06": "Father's Day",
"22-06": " ",
"29-06": " ",
"06-07": "Muharram",
"13-07": " ",
"20-07": " ",
"27-07": " ",
"03-08": "Friendship Day",
"09-08": "Raksha Bandhan",
"10-08": " ",
"15-08": "Independence Day",
"17-08": " ",
"24-08": " ",
"27-08": "Ganesh Chaturthi",
"31-08": " ",
"07-09": " ",
"14-09": "Hindi Diwas",
"21-09": " ",
"28-09": " ",
"02-10": "Dussehra & Gandhi Jayanti",
"05-10": " ",
"12-10": " ",
"21-10": "Laxmi Puja",
"22-10": "Govardhan Puja",
"19-10": "Dussehra",
"26-10": " ",
"02-11": " ",
"05-11": "Guru Nanak Jayanti",
"09-11": " ",
"16-11": " ",
"23-11": " ",
"30-11": " ",
"07-12": " ",
"14-12": " ",
"21-12": "Shortest Day of Year",
"28-12": " ",
"14-01": "Makara Sankranti",
"02-02": "Vasant Panchami",
"19-02": "Chhatrapati Shivaji Maharaj Jayanti",
"26-02": "Maha Shivaratri",
"14-03": "Holi - Colour Day",
"01-04": "Bank's Holiday",
"07-06": "Bakrid & Eid al-Adha",
"25-12": "Christmas",
};
const festival = {
"06-01": "Guru Gobind Singh Jayanti",
"10-01": "Tailang Swami Jayanti",
"12-01": "Swami Vivekananda Jayanti & National Youth Day",
"13-01": "Lohri & Hazarat Ali's Birthday",
"23-01": "Subhas Chandra Bose Jayanti",
"02-02": "Vasant Panchami",
"04-02": "World Cancer Day",
"12-02": "Guru Ravidas Jayanti",
"14-02": "Valentine's Day",
"23-02": "Maharishi Dayanand Saraswati Jayanti",
"01-03": "Ramakrishna Jayanti",
"08-03": "International Women's Day",
"13-03": "Holika Dahan",
"20-03": "Parsi New Year",
"31-03": "Eid al-Fitr",
"10-04": "Mahavir Swami Jayanti",
"22-04": "Earth Day",
"24-04": "Vallabhacharya Jayanti",
"29-05": "Maharana Pratap Jayanti",
"31-05": "World No Tobacco Day",
"05-06": "World Environment Day",
"11-06": "Kabirdas Jayanti",
"21-06": "International Yoga Day",
"27-06": "Jagannath Rathyatra & Islamic New Year",
"10-07": "Guru Purnima",
"31-07": "Tulsidas Jayanti",
"15-09": "Engineer's Day",
"05-09": "Onam, Teachers' Day",
"22-09": "Maharaja Agrasen Jayanti & Autumnal Equinox",
"30-09": "Durga Ashtami",
"01-10": "Maha Navami",
"07-10": "Valmiki Jayanti & Meerabai Jayanti",
"10-10": "Karwa Chauth",
"20-10": "Diwali-Lakshmi Puja & Narak Chaturdashi",
"23-10": "Bhaiya Dooj",
"28-10": "Chhath Puja",
"14-11": "Children's Day",
"01-12": "World AIDS Day",
"27-12": "Guru Gobind Singh Jayanti",
};
const birthday = {
"21-02": "Anita Birthday",
"12-03": "Gyanchand Birthday",
"20-12": "Preeti Birthday",
"17-06": "Rajesh Birthday",
"00-03": "",
"00-03": "",
"00-03": "",
};
const weekDays = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const months = [
"January 2025", "February 2025", "March 2025", "April 2025", "May 2025", "June 2025",
"July 2025", "August 2025", "September 2025", "October 2025", "November 2025", "December 2025"
];
function isBankHoliday(day, month, year) {
const date = new Date(year, month, day);
return date.getDay() === 6 && (Math.floor((day - 1) / 7) === 1 || Math.floor((day - 1) / 7) === 3);
}
function generateCalendar() {
const container = document.getElementById("calendar-container");
months.forEach((month, monthIndex) => {
const monthDiv = document.createElement("div");
monthDiv.className = "month";
const monthTitle = document.createElement("h3");
monthTitle.textContent = month;
monthDiv.appendChild(monthTitle);
const weekDaysDiv = document.createElement("div");
weekDaysDiv.className = "week-days";
weekDays.forEach(day => {
const dayLabel = document.createElement("div");
dayLabel.textContent = day;
weekDaysDiv.appendChild(dayLabel);
});
monthDiv.appendChild(weekDaysDiv);
const daysDiv = document.createElement("div");
daysDiv.className = "days";
const daysInMonth = new Date(2025, monthIndex + 1, 0).getDate();
const firstDay = new Date(2025, monthIndex, 1).getDay(); // Get the day of the week for the 1st of the month
// Adjust firstDay to match the Monday-start convention (JavaScript's Sunday = 0, Monday = 1,...)
const adjustedFirstDay = (firstDay === 0) ? 6 : firstDay - 1;
// Add empty divs for days before the 1st of the month
for (let i = 0; i < adjustedFirstDay; i++) {
const emptyDiv = document.createElement("div");
emptyDiv.className = "day";
daysDiv.appendChild(emptyDiv);
}
for (let day = 1; day <= daysInMonth; day++) {
const dateKey = `${String(day).padStart(2, '0')}-${String(monthIndex + 1).padStart(2, '0')}`;
const dayDiv = document.createElement("div");
dayDiv.className = "day";
dayDiv.textContent = day;
if (holidays[dateKey]) {
dayDiv.classList.add("holiday");
dayDiv.setAttribute("title", holidays[dateKey]);
}else if (festival[dateKey]) {
dayDiv.classList.add("festival");
dayDiv.setAttribute("title", festival[dateKey]);
}else if (birthday[dateKey]) {
dayDiv.classList.add("birthday");
dayDiv.setAttribute("title", birthday[dateKey]);
} else if (isBankHoliday(day, monthIndex, 2025)) {
dayDiv.classList.add("bank-holiday");
dayDiv.setAttribute("title", "Bank Holiday");
}
daysDiv.appendChild(dayDiv);
}
monthDiv.appendChild(daysDiv);
container.appendChild(monthDiv);
});
}
generateCalendar();
</script>
<!--------------------------FUNCTION CODE START---------------->
</body>
</html>