Vinh La Kiến

54 bundles
1 file4 months ago
1

let d = 29;

123456789101112131415161718192021222324252627282930313233
let d = 29; let m = 2; let y = 2400; let isValid = false; let isLeapYear = y % 400 == 0 || (y % 4 == 0 && y % 100 != 0); let maxDay = 0; if (y > 1) { switch (m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: maxDay = 31; break; case 4: case 6: case 9: case 11: maxDay = 30; case 2: maxDay = isLeapYear ? 29 : 28; } if (maxDay > 0) { isValid = d >= 1 && d <= maxDay; } }