mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 22:14:26 +01:00
fix: date comparison
This commit is contained in:
@@ -54,7 +54,11 @@ const parseDateDiff = (date: Date, currentDate: Date): ParsedDate => {
|
||||
};
|
||||
|
||||
export const formatAbsolute = (date: Date, currentDate: Date = new Date()): string => {
|
||||
if (date.getDate() === currentDate.getDate()) {
|
||||
if (
|
||||
date.getFullYear() === currentDate.getFullYear() &&
|
||||
date.getMonth() === currentDate.getMonth() &&
|
||||
date.getDate() === currentDate.getDate()
|
||||
) {
|
||||
return date.toLocaleTimeString();
|
||||
}
|
||||
return date.toLocaleString();
|
||||
|
||||
Reference in New Issue
Block a user