feat: Add date formatting utility functions and integrate them across components
This commit is contained in:
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
|
||||
import { Card, CardHeader, CardContent } from "@/components/ui/Card";
|
||||
import Button from "@/components/ui/Button";
|
||||
import { Input } from "@/components/ui/Input";
|
||||
import { formatDateForInput } from "@/lib/utils";
|
||||
|
||||
export default function ContractForm() {
|
||||
const [form, setForm] = useState({
|
||||
@@ -133,11 +134,11 @@ export default function ContractForm() {
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Date Signed
|
||||
</label>
|
||||
</label>{" "}
|
||||
<Input
|
||||
type="date"
|
||||
name="date_signed"
|
||||
value={form.date_signed || ""}
|
||||
value={formatDateForInput(form.date_signed)}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
@@ -145,11 +146,11 @@ export default function ContractForm() {
|
||||
<div className="md:col-span-2">
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Finish Date
|
||||
</label>
|
||||
</label>{" "}
|
||||
<Input
|
||||
type="date"
|
||||
name="finish_date"
|
||||
value={form.finish_date || ""}
|
||||
value={formatDateForInput(form.finish_date)}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user