diff --git a/src/components/modal/EditDate.vue b/src/components/modal/EditDate.vue index 9723d5d4..e5f96158 100644 --- a/src/components/modal/EditDate.vue +++ b/src/components/modal/EditDate.vue @@ -10,6 +10,8 @@ 5000) return null; + if (month < 0 || month > 11) return null; + + // Number of days in month + const daysInMonth = new Date(year, month + 1, 0).getDate(); + if (day < 1 || day > daysInMonth) return null; + + // Validate time + if (hour < 0 || hour > 23) return null; + if (minute < 0 || minute > 59) return null; + if (second < 0 || second > 59) second = 0; + + return new Date(Date.UTC(year, month, day, hour, minute, second)); }, }, });