This commit is contained in:
Marian Paul
2026-01-17 21:59:57 +01:00
parent 0bab585630
commit a6fe2ef633
4 changed files with 69 additions and 31 deletions

View File

@@ -102,6 +102,12 @@ export function ScheduleModal({ projectName, isOpen, onClose }: ScheduleModalPro
return
}
// Validate duration
if (newSchedule.duration_minutes < 1 || newSchedule.duration_minutes > 1440) {
setError('Duration must be between 1 and 1440 minutes')
return
}
// Convert local time to UTC
const scheduleToCreate = {
...newSchedule,
@@ -309,12 +315,14 @@ export function ScheduleModal({ projectName, isOpen, onClose }: ScheduleModalPro
min="1"
max="1440"
value={newSchedule.duration_minutes}
onChange={(e) =>
onChange={(e) => {
const parsed = parseInt(e.target.value, 10)
const value = isNaN(parsed) ? 1 : Math.max(1, Math.min(1440, parsed))
setNewSchedule((prev) => ({
...prev,
duration_minutes: parseInt(e.target.value) || 0,
duration_minutes: value,
}))
}
}}
className="neo-input w-full"
/>
<div className="text-xs text-gray-600 mt-1">

View File

@@ -73,7 +73,7 @@ export function formatNextRun(isoString: string): string {
}
// Further out - show day and time
return date.toLocaleDateString([], {
return date.toLocaleString([], {
weekday: 'short',
hour: 'numeric',
minute: '2-digit'