* Generate a random birthday (age 19-25). * @returns {{ year: number, month: number, day: number }}
()
| 28 | * @returns {{ year: number, month: number, day: number }} |
| 29 | */ |
| 30 | function generateRandomBirthday() { |
| 31 | const currentYear = new Date().getFullYear(); |
| 32 | const age = 19 + Math.floor(Math.random() * 7); // 19 to 25 |
| 33 | const year = currentYear - age; |
| 34 | const month = 1 + Math.floor(Math.random() * 12); // 1 to 12 |
| 35 | const maxDay = new Date(year, month, 0).getDate(); // days in that month |
| 36 | const day = 1 + Math.floor(Math.random() * maxDay); |
| 37 | return { year, month, day }; |
| 38 | } |