fix(timesheet): show entry date without time in mobile cards

This commit is contained in:
2026-04-26 10:32:07 +03:30
parent ab6fe908d3
commit 4befb50eb7

View File

@@ -178,6 +178,15 @@ const formatDateTime = (value: string, locale: "en" | "fa") => {
}).format(parsed); }).format(parsed);
}; };
const formatDateOnly = (value: string, locale: "en" | "fa") => {
const parsed = parseApiDateTime(value);
if (!parsed) return value;
return new Intl.DateTimeFormat(locale === "fa" ? "fa-IR" : "en-US", {
dateStyle: "medium",
}).format(parsed);
};
const formatDuration = (entry: TimeEntry, now = Date.now()) => { const formatDuration = (entry: TimeEntry, now = Date.now()) => {
const start = parseApiDateTime(entry.start_time)?.getTime(); const start = parseApiDateTime(entry.start_time)?.getTime();
const end = entry.end_time ? parseApiDateTime(entry.end_time)?.getTime() : now; const end = entry.end_time ? parseApiDateTime(entry.end_time)?.getTime() : now;