fix(timesheet): show entry date without time in mobile cards
This commit is contained in:
@@ -178,6 +178,15 @@ const formatDateTime = (value: string, locale: "en" | "fa") => {
|
||||
}).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 start = parseApiDateTime(entry.start_time)?.getTime();
|
||||
const end = entry.end_time ? parseApiDateTime(entry.end_time)?.getTime() : now;
|
||||
|
||||
Reference in New Issue
Block a user