Refactor: Implement datetime standardization

This commit is contained in:
gpt-engineer-app[bot]
2025-10-13 17:32:58 +00:00
parent 29f4f3c2aa
commit 5feee9f4bc
7 changed files with 472 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { toDateOnly, toDateWithPrecision } from "@/lib/dateUtils";
export type DatePrecision = 'day' | 'month' | 'year';
@@ -70,11 +71,11 @@ export function FlexibleDateInput({
let newDate: Date;
switch (newPrecision) {
case 'year':
newDate = new Date(year, 0, 1); // January 1st
newDate = new Date(year, 0, 1); // January 1st (local timezone)
setYearValue(year.toString());
break;
case 'month':
newDate = new Date(year, month, 1); // 1st of month
newDate = new Date(year, month, 1); // 1st of month (local timezone)
break;
case 'day':
default: