| 257 | } |
| 258 | |
| 259 | export async function addClassesFromAugustToMay() { |
| 260 | const startDate = new Date('2024-08-01T00:00:00+05:30'); |
| 261 | const endDate = new Date('2025-05-31T23:59:59+05:30'); |
| 262 | |
| 263 | for ( |
| 264 | let date = new Date(startDate); |
| 265 | date <= endDate; |
| 266 | date.setDate(date.getDate() + 1) |
| 267 | ) { |
| 268 | if (date.getDay() === 5) { |
| 269 | // Friday |
| 270 | await db.event.create({ |
| 271 | data: { |
| 272 | title: 'Web 3 Class', |
| 273 | start: new Date(date.setHours(19, 30, 0, 0)), |
| 274 | end: new Date(date.setHours(21, 30, 0, 0)), |
| 275 | }, |
| 276 | }); |
| 277 | } else if (date.getDay() === 6 || date.getDay() === 0) { |
| 278 | // Saturday or Sunday |
| 279 | await db.event.create({ |
| 280 | data: { |
| 281 | title: 'WebDevs/Devops Class', |
| 282 | start: new Date(date.setHours(19, 30, 0, 0)), |
| 283 | end: new Date(date.setHours(21, 30, 0, 0)), |
| 284 | }, |
| 285 | }); |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | async function seedDatabase() { |
| 291 | try { |