0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00

Added Just now as a timestamp

ref https://linear.app/tryghost/issue/AP-282/render-notes-in-the-frontend
This commit is contained in:
Djordje Vlaisavljevic 2024-09-19 20:27:05 +01:00 committed by Fabien 'egg' O'Carroll
parent 0cf5d11bf2
commit 4aa5e4f091

View file

@ -27,7 +27,11 @@ export const getRelativeTimestamp = (date: Date): string => {
return `${interval}m`; return `${interval}m`;
} }
return `${seconds} seconds`; if (seconds < 1) {
return `Just now`;
}
return `${seconds}s`;
}; };
export default getRelativeTimestamp; export default getRelativeTimestamp;