login time
This commit is contained in:
+9
-1
@@ -6,6 +6,14 @@ export const formatTime = (dateInput: string | Date | null | undefined) => {
|
||||
return format(date, "HH:mm");
|
||||
};
|
||||
|
||||
export const formatTimeWithSeconds = (
|
||||
dateInput: string | Date | null | undefined
|
||||
) => {
|
||||
if (!dateInput) return "";
|
||||
const date = typeof dateInput === 'string' ? new Date(dateInput) : dateInput;
|
||||
return format(date, "HH:mm:ss");
|
||||
};
|
||||
|
||||
export const formatDate = (dateInput: string | Date | null | undefined) => {
|
||||
if (!dateInput) return "";
|
||||
const date = typeof dateInput === 'string' ? new Date(dateInput) : dateInput;
|
||||
@@ -32,7 +40,7 @@ export const formatDate = (dateInput: string | Date | null | undefined) => {
|
||||
if (isSameWeek(date, now, { weekStartsOn: 1 })) {
|
||||
return format(date, "EEEE");
|
||||
}
|
||||
return format(date, "dd/MM");
|
||||
return format(date, "MM/dd");
|
||||
};
|
||||
|
||||
export const formatDateMDY = (dateInput: string | Date | null | undefined) => {
|
||||
|
||||
Reference in New Issue
Block a user