This commit is contained in:
2025-07-06 22:25:20 +02:00
parent eaf5295843
commit 01286cf9fd
27 changed files with 216 additions and 153 deletions

View File

@@ -1,4 +1,3 @@
import React, { useState } from 'react';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
@@ -17,8 +16,21 @@ interface JobFormProps {
const formatDateForInput = (dateString: string | undefined | null): string => {
if (!dateString) return '';
// Convert ISO string to datetime-local format (YYYY-MM-DDTHH:MM)
return new Date(dateString).toISOString().slice(0, 16);
// Create a date object in local timezone
const date = new Date(dateString);
// Format to YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
// Format to HH:MM
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
// Combine into format required by datetime-local (YYYY-MM-DDTHH:MM)
return `${year}-${month}-${day}T${hours}:${minutes}`;
};
const JobForm: React.FC<JobFormProps> = ({ job, onSubmit, onCancel }) => {